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

Night song festival

August 20th, 2008

Yesterday we were at öölaulupidu, the night song festival, which was held at the song festival arena in Tallinn to celebrate the 20th anniversary of the singing revolution events. Song festivals are hold every 4-5 years, next one is next year, so this event was different and I expected less people. Oh was I wrong, it was as crowded as I had ever seen, and always very impressive.

Giustino gives a good overview of the multiple meaning of this event. I also liked it, the songs were very beautiful and the whole thing was very moving. You saw that people remembered events from 20 years ago, and the songs from that time vivified these emotions. It’s not something we would know in France (in fact I don’t know of almost any French song that speaks about France or French, while they are so many in Estonian). And of course the events in Georgia suddenly made everybody remember that liberty is precious and can be lost.

I haven’t lived these events, but I was also moved, and felt a bit Estonian as such.

Update: A nice picture.

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.