« Moodgeist privacy vs data publication/reuse concerns | Main | What's a "mood" and "mood message" anyway? »

The Moodgeist URL-s and feeds

Here are the feeds and URL-s you can use with Moodgeist to retrieve the data. Some people would also call it the “Moodgeist API”, but API is a bit of a fancy word for a few simple URL-s, so we just call them URL-s and feeds.

Quick start

First off, if you’re a nerd and want to get going quickly then here are the feeds in regexp format, straight from the config. Split on multiple lines for layout — each expression actually spans two lines.

'^/do/view/latest/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?$'
'^/do/view/latestcompact/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?$'
'^/do/view/latestfeed/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?$'
'^/do/view/keywords/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?$'
'^/do/view/keywordscompact/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?$', 
'^/do/view/keyword/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?(?P<keyword>.+)/$'
'^/do/view/keywordfeed/((?P<count>(10|50|100))/)?
((?P<language>[a-zA-Z][a-zA-Z0-9-]+)/)?(?P<keyword>.+)/$'

Ehrm… WHAT? Ok, here’s the English version.

Feed types and parameters

There are two types of feeds. “Keywords” feeds and latest feeds.

“Latest” feeds are the following. Use them as http://www.moodgeist.com/feedspec-from-below. See also below for examples.

  • /do/view/latest/ — display latest moods as HTML
  • /do/view/latestcompact/ — display latest moods as compact HTML with no header or footer, good to use on a site — but DO NOT yet use these in “critical” applications because the layout/CSS styles will definitely change so that you could format against them better.
  • /do/view/latestfeed/ — latest moods as RSS
  • /do/view/keyword/”whichkeyword”/ — display latest moods containing “whichkeyword” (without quotes).
  • /do/view/keywordfeed/”whichkeyword”/ — latest moods containing “whichkeyword” as RSS

“Keyword” feeds are not available as RSS, because I couldn’t figure out how to convert the “weighted” displaying to “streamed” RSS. They display the popular words used in mood messages.

  • /do/view/keywords/ — display most popular keywords as simple HTML
  • /do/view/keywordscompact/ — same as above, compact view for your webpage, layout/CSS will change.

All of the above may have the following added to them. In keyword feeds, these parameters must come BEFORE the keyword.

  • /count/, where count is either 10, 50 or 100 — display this number of mood messages or keywords matching the query. If fewer are found, then fewer are displayed. Default is 50.
  • /languagecode/, for example /fr/ — display only the moods where the Skype Name’s profile language was set to this language. Skype uses 2-letter ISO country codes so that’s what you should also use here. Many profiles don’t have a language set, so if you limit to a language, you will likely get fewer results, but there’s a good chance that they’re more “accurate”, i.e the moods are in that particular language.

“languagecode” must come after “count” and both are optional, i.e you may omit one or both of them. If both are there, then “languagecode” comes after “count”.

Examples

The above was probably a bit confusing so let’s take a look at a few simple examples.

Other notes

All output uses data from the past 14 days and not the whole history. This is to make sure that the data you see is “fresh”. Also it’s good against “poisoning” — even if someone “spams” or “poisons” the data with some random junk or garbage, it will go away in 14 days. Obviously if it’s some big-scale problem, we’ll intervene, but this ensures that any “fluctuations” in data will disappear over time on their own. I think del.icio.us does it kind of the same way, e.g they said in a presentation they don’t have “most popular links of all times” specifically because of this.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)