The Weblog of Vincent Oberle - Thoughts and opinions about technology and business

Slow blogging, busy at work

April 17th, 2008

Not much blogging lately. Since joining the Core team 3 months ago, I’ve been getting more and more busy, working hard on the next version of Skype (there is cool stuff coming…). So my thoughts are all on Skype internal stuff, which is unfortunately not blogging material.

In Skype news, one important thing that happened lately is not product related, but a marketing action, with Skype being used a lot by Oprah in her show. This is huge: In the US Oprah is very popular and her show has a huge audience. I’ve seen extract of her program and she keeps mentioning Skype and how great it is, she really loves what it allows to do in her show.

Henri is big boy now, he is learning so fast and so much, understands plenty of Estonian and French words, starts to speak. Cool man!

IMG_5385.JPG

Extract your chat history with Skype4Py

February 10th, 2008

Following my posts about scripting Skype (which also appeared on Skype Journal), I wrote a little article for the Skype Developer program newsletter of January, which I also post here.

In the “Skype 3.X discussion” public chat, there was a discussion about having a plugin that could extract all your information (profile, buddy list, history list, chat logs, etc.) from Skype and save it in a neutral format such as RSS. For chat, it was mentioned that Pamela and Skylook record chat sessions, but the original need came from a Mac user, while these two plugins are only available under Windows. How complicated is it to write a plugin that would extract say chat messages from Skype? Can it be made portable across all desktop platforms supported by Skype?

For writing simple plugins quickly and easily, and have a portable result, I recommend using Python and the excellent Public API wrapper Skype4Py. The requirements are simple, only Python and Skype4Py are needed. Under Linux Python is most likely already there, for Windows and Mac it can be obtained from Python web site. Skype4Py can be downloaded from the Skype4Py site.

The little script I will write will use Skype’s API and Skype4Py to get all the chats, and for each chat print every messages. The Skype4Py reference manual has all the documentation we need.

Before sending any command to Skype, we need to initialize Skype4Py and connect to the Skype client. We can optionally set the name under which the plugin will appear in the API authorization request window (if not set, ‘Skype4Py’ is used).

import Skype4Py

skype = Skype4Py.Skype()
skype.FriendlyName = 'Extract_chat_history'
skype.Attach()

Then we need to get the list of all Chat objects. With the text API this would be done using the “SEARCH CHATS” command. The corresponding command in Skype4Py is hidden behind the Chats property of the ISkype class. This property has a list of IChat objects, containing all chats the user has had:

chats = skype.Chats

The IChat class has the Messages property, representing all messages of this chat, as a list of IChatMessage objects. Printing all messages bodies of all chats becomes then trivial:

for c in chats:
    for m in c.Messages:
        print m.Body

If you have a lot of chats, like I do, running this script will be quite long. Therefore, for testing I recommend printing only a few chats, which in Python means 4 characters only:

for c in chats[:2]:  # print only 2 chats

The script must be run from the command line, as it prints the messages on the standard output. To get the messages in a text file, just redirect the output to a file (’python extract_chat_history.py > history.txt’).

We only print the body of the chat. To make it really useful we need to add the name of the sender (FromDisplayName property of IChatMessage) and the time of the message (Timestamp property). We can also print additional information about the chat itself, such as the topic (Topic property of IChat). Getting the member list is as easy (MemberObjects or Members properties of IChat).

When running the script, we notice that the message bodies are not sorted by time. It’s quite easy to fix it with the sort function and a custom comparison function:

for c in chats:
    # c.Messages is a tuple, to be able to sort it,
    # convert it into a list
    msg_list = list(c.Messages)
    # Sorting based on timestamps, with custom compare fct
    def message_timestamp_cmp(x, y):
        return int(x.Timestamp - y.Timestamp)
        # why are timestamps float and not int in Skype4Py?
    msg_list.sort(message_timestamp_cmp)
    for m in msg_list:
        print m.Body

Another possible annoyance is that for each buddy, there are many single chats instead of just one. If we wish, we can group them during the extraction (for example, search all IChat objects that have only 2 members and group them by their buddy Skype name).

One can see how easy it is to write a plugin that extracts data from Skype using Skype4Py, in a portable way. More examples are available on my web site.

Joining the Skype Core Library team

January 23rd, 2008

2.5 years ago, I was the first engineer of the embedded team at Skype. Since then, we built a team and did great things: Released many devices, worked with many partners, fixed lots of bugs, ported Skype to many platforms… But as with any job, there comes a time where you know it well enough so that the daily job lacks in challenges, and when it’s time to change.

And so, I’m very happy to join the Skype Core Library team. This team is responsible for providing the common functionality included in all Skype client software (including Devices). It is an amazing piece of software, developped by amazing engineers, and it is indeed a honour, as well as a fantastic challenge, to be part of that team.

My five favorite food things in Estonia

January 20th, 2008

Having done the list of food things I miss in Estonia, I thought I should also do the list of things I like the most in Estonia (I have written more generally about Estonian cuisine in the past). These are things I didn’t know before coming to Estonia, or that are just better in Estonia. It’s not necessarily only Estonian stuff.

  • Chanterelles: Oh do I love chanterelles season. These mushrooms are plenty on the market, for fairly cheap. Cooked with onions, cream, dill, smoked ham and eaten with new potatoes, delicious.
  • Couldberries: Small little yellow berries that grow in wetlands, they are amazing in marmalade, fantastic in liquor (and no words to describe the grand-father 30-year liquor.. no, I don’t share this one..).
  • Pork: While beef and chicken are less good than in France, pork is better and more interesting. There is also a big choice of meat for grilling (grilling is a national sport) and lots of nice marinated meat. Good, cheap, fun.
  • Dumplings (pelmeni): There are many different sorts, but even just the frozen ones are nice (typical student food probably). With sour cream and a beer.
  • Marzipan pralines: The ones Kalev sells in the box with the picture of the little girl.

Also worth mentioning: Seljanka (thick Russian soup), elk sausages, beer in general (lots of local sorts), strawberries (small, but very tasty, I cannot wait for the season to start), potato salad, etc.

Five food things I miss in Estonia

January 13th, 2008

Making such a list is actually not that easy, because I do find most of the things I like here (and of course I also have many things I didn’t have in France).

Yet there are a few things I miss, in no particular order:

  • Artichokes: Hearts can be found in cans, but I’ve never seen fresh ones. Pity, since it’s something really good.
  • Baguette: Obviously… We can find fine white bread, and some shops sell baguette, but it’s not really good. Not all bakeries in France make good bread either, but when it’s good it’s just amazing.
  • Viennoiserie, like croissants, etc: Supermarkets sell lots of them here, but they just don’t look well and aren’t specially good. In France, again in good bakeries, they are just delicious.
  • Coffee ice-cream: That’s a funny one, there are lots of ice-creams here, many good ones, but there is no coffee ice-cream, and it happens to be my favorite one.
  • Good beef meat: To be accurate there is good beef in Estonia, but it’s just damn hard to find, because it’s rare and there are no indications of the type and origin of the animal. This is much better indicated in France and thus it’s easier to find good one.

I could make the list bigger by adding good chicken (seems there is no “First class” chicken here that is grown in fresh air and tastes great). Or rabbit, which is something excellent, we get it only because Ingrid’s grandmother knows the right people on Tartu’s market.

Best toy for children: LEGO

January 12th, 2008

In my childhood, I always wanted LEGO for toys, so it’s no big surprise that Henri is getting some too. Of course he’s too young for standard LEGO so he’s getting Duplo. And with Ingrid we got quickly convinced it’s the best way to use the toy money.

Duplo have great build quality. They are safe, there are never any sharp edges, small pieces that could be swallowed and I trust LEGO not to use toxic materials. They are very solid and overall not much more expensive than other much less good toys.

The most interesting aspect is that they offer so many levels of playing. At the simplest, just taking them in and out of their box is already very interesting. Or take the big farm set 4665, even if Henri is too young to make up stories with the animals, putting things in the house through the small doors, or checking through the windows is very fun. Parents can so quickly build new things that will look like a new toy so interest can be renewed regularly. And Henri is probably not very far from building stuff himself. At 17 months, he already knows how to put pieces together, and is building big towers.

DUPLO Big Farm

Finally, another plus is that any new LEGO box, in addition to being a new toy, will make the old ones interesting again.

I cannot wait for Henri to be old enough so that we can build amazing cities or castles together :)

More scripting Skype: Moods to Twitter and command-line file transfer

December 20th, 2007

I have blogged before about how using the Skype4Py library makes it very easy to script Skype and add little features to it, in a portable way. I have written two such little scripts recently. Their code is short and simple, and while I only tested them under Linux they should also work under Windows and Mac. They can be found with my Skype tools.

The first script will send your own mood messages to Twitter. There are two reasons for doing that. First many people use the mood message like Twitter, to say what they think or as a micro-blogging tool. So the mood message can be a very good “Twitter editor”. The second reason is that Skype doesn’t keep an history of your mood messages. This provides such an history, which can be private if you set your Twitter privacy settings accordingly.

The second script is to make my life easier. Under Linux I’m often in the command-line and I often have to send some file to colleagues. Currently that requires to get to the Skype UI, find the contact, choose the Send file option and navigate to the directory where my file to send is, lots of clicks.

So I’ve written the little send_file.py script. Just specify the Skype name(s) or the display name(s) of the people you want to send the file too, and it will open the file selection window to the current directory. From there you just have to choose the file to send. Why not specify directly the file name to transfer on the command-line? The Skype API doesn’t allow this, to prevent external applications to transfer files without the knowledge of the user. Yet despite this limitation, the script makes the file transfer operation much faster.

Note that “send_file.py John” will be enough to send the file to all contacts that have John in their name. Under Linux, this script requires at least Skype 2.0.0.27.

High Quality Video Skype calls

December 19th, 2007

In the recent weeks, Skype launched High Quality Video on Windows: 640×480 (4 times more pixels) and 30 fps (double as standard Skype video). I got last week one of the camera that can support it and I tried it with my mother. Her feedback was excellent (others agree). It’s much nicer to use in full screen. The great Logitech camera also brings a plus, as it deals well with difficult lighting conditions. Such conditions are almost the rule for webcam users, yet cheap webcams are just very bad in that case.

My mother doesn’t have a High Quality Video camera, and she only has a slow Celeron based laptop. But that was enough for receiving High Quality Video, since it’s sending that requires a powerful dual-core processor. This setup is actually fine for us, since most of the time during video calls with my mother, we have one-way video. I need to run with the camera after Henri and cannot look at the screen…

Spending some money on a good webcam is now well worth it.

Scripting Skype

December 11th, 2007

I’ve been using Python as my main scripting language for a while now. The Skype Linux tools I wrote a little while ago were already in Python. They used a custom wrapper for the API that Skype exposes for 3rd party applications. There is however a much better Python wrapper available now, Skype4Py, which is even officially supported by Skype.

With it, it becomes quite simple to script Skype for some simple tasks. Added benefit of using Python, your scripts will be portable across the 3 desktop platforms supported by Skype, Windows, Mac and Linux.

Here is an example of a small scripts I wrote to solve a problem.

Skype multi-chats are great for discussions on a project or in a team. But sometimes I need an answer from each member of a multi-chat. Just throwing the question in the chat will result that systematically some people don’t answer (don’t ask me why, I don’t get it either…). So I wrote a little script that will send as individual chat messages the text that follows the /all command. For example write in the multi-chat:
/all When do you go in holidays this summer?
and each member of the chat will receive the “When do you go in holidays this summer?” individual message.

Here is the code:

import Skype4Py
import re

skype = Skype4Py.Skype()
skype.Attach()  # Attach to Skype client

def message_status(Message, Status):
    if Status != Skype4Py.cmsSent: return
    if Message.Sender != skype.CurrentUser: return
    r = re.search (r'/all (.+)', Message.Body)
    if r:
        msg = r.group(1).strip()
        for member in Message.Chat.MemberObjects:
            if member.Handle == skype.CurrentUserHandle:
                continue # don't sent to myself
            skype.SendMessage(member.Handle, msg)

skype.OnMessageStatus = message_status

while(True): pass # Infinite loop, ctrl^C to break

Intercepting chat messages can be used for many things. Do you want a /sms command in a chat that will send an SMS to each member in the chat? It will probably not take you much more lines of code.

iPhone love

December 10th, 2007

Since a couple of months, I have been using an iPhone. In one of the first posts of this blog, in mid 2004, I wondered why we didn’t have an iPod phone yet. It took a long time, but it was worth the wait. The iPhone is an amazing device.

There have been lots of critics of the iPhone, often citing its lack of some features compared to some other phones. These critics are completely unjustified. The iPhone has the most important applications, but more important, they work so much better than on any other phone. As pointed out by alpheccar, its beauty is also in its simplicity.

First it is an iPod, and an amazing one. It does the iPod job very well. Cover flow in particular is something I didn’t get at all how cool it was before using it. It brings something very important back to digital music listening experience, the CD feeling. We all have many CDs, some for a long time, some we really love and we know them first by their cover. I am still listening to my CDs, one reason being that I like to go through them. Browsing your collection using Cover Flow just gives you the feeling of looking through your CD collection. This feeling is even emphasized by the iPhone touchscreen. And it’s a great feeling!

The iPhone doesn’t support Flash. But what is the most useful Flash app on PC? YouTube of course, and the iPhone plays YouTube videos better than a PC. It’s using H.264, and the quality is just beautiful. I’ve only tested it with wifi, as I’m not using a data plan with it (not really necessary, as most of the time I’m under wifi coverage anyway).

I’ve been wondering why I prefer the iPhone over the Nokia N800/N810 Internet tablets, which are also good devices. I think it’s because from a usage point of view, I do things with the N8×0 that I would do with my laptop, while I do things with the iPhone that I would do with my phone. So compared to my laptop, the N8×0 is less good. It’s a good device, but using Skype on it is less practical than on a laptop, same for web browsing or working. And it’s still slightly big to really fit in a pocket. While compared to my previous phones, the iPhone is amazing. Oh even better, compared to previous iPods the iPhone is amazing. And it remains usefull on the road. And the problem for the N800 is still that on THE feature where it competes head-to-head with the iPhone, the web browser, the iPhone is way better.

In general the iPhone UI is that good that I have been wondering how do they do it? I mean it’s so fast, so responsive. One can be watching a video and in 2 finger press (cannot say click here..) and 1 second be in the web browser. And in that web browser, zooming will works so well and is so fast.

One clearly sees Apple worked hard to make a usable phone. An example I like: On my former Nokia phone, to put it in silent mode, I had to unlock it, go in a menu, choose between several options (what is the different between silent and meeting modes?) and then relock it. On the iPhone, there is one real switch on the side, which puts in on vibrator. Can be done without removing the phone from the pocket, or unlocking it. Seems so obvious to do it like that!

Putting still a negative touch, a real pity is that Apple makes is so tough for non iTunes applications to use it. I’m using it under Linux, and while I now can synchronize music with covers and videos from Amarok, I miss calendar synchronization. Well on the other hand I do this synchronization over wifi, which is pretty cool (iTunes users at stuck with the USB cable for now).

There is no doubt that the iPhone is a game changer in the mobile industry. Every new phone will be compared to it now, and that’s a tough standard to match.

Maybe the most amazing thing is that Apple got it so right, so stable, so usable in its version 1.0. One wonders what will they come up next with. The SDK that should be released in February will be very interesting to watch. What will it look like?