The moodgeist pinger protocol, or "ping API", is how Moodgeist collects its mood messages. We provide a reference Python client (see below), but you are more than welcome to contribute a pinger of your own, or embed MoodGeist into any of your Skype add-ons.

If you just want to run Pinger on your computer, see this page, where we have Pingers available for Windows, Mac OS X and Linux. The following discussion is about writing your own Pinger.

Essentially, the ping is a simple HTTP POST request to the following URL: http://moodgeist.com/do/ping/. The POST must have these parameters. All parameters must be present.

parameter name

example value

maximum length

can be empty?

comment

protocol

1

1

no

The Moodgeist protocol version. Currently, only “1” is defined.

skypename

echo123

32

no

Skype Name whose mood message you are pinging over. Note that 32 is also the maximum allowed length of a Skype Name in Skype.

mood_text

I am very happy

256

no

The pinged mood message as URL-encoded UTF8

poster

echo123

32

no

Skype Name who is running the pinger and pinging over the mood message.

skypename_language

fr

7

yes

Language set in skypename’s profile. May be blank, but must always exist in the request.

All parameters except mood_text should be plain ASCII. mood_text supports international characters — it the POST, it must be a simple URL-encoded UTF-8 bytestream. UTF-8 also happens to be the encoding that the Skype API returns messages in, so you can just “pass them through” from the API to the POST (after proper URL-encoding, of course).

The ping URL returns a simple string with the numeric code and text explanation. The numeric code is also the HTTP response code.

Reference client

There’s a reference (example) Python client available: moodgeist-reference-pinger.py.txt. To run it, you also need the Skype Python API wrapper, although I patched a bit for my purposes: around line 170, disable all the self._send commands so that it wouldn’t send any “startup” commands on its own. Here’s my patched version as skypeserver_py.txt — just drop it to Python’s “site-packages” folder.

The reference client illustrates how it should work — first you ping over everyone’s current mood from your contact list, and then you sit around processing ongoing mood change events.

You can leave the reference client running also for daily use if you’re of the hacker type, but for daily use, it’s not very practical, so we welcome friendlier versions of the Pinger, and also non-Win32 ones. The API connection sometimes dies for no apparent reason and it won’t inform you, so it’s not very resilient — if you notice the API connection was lost, just re-run it.

MoodGeist/PingApi (last edited 2007-03-13 21:55:39 by JaanusKase)