Free DNS provides easy shared DNS hosting & URL forwarding

Monday, June 8, 2009

Riffly API update

These are some additional information I managed to obtain about the riffly.com services. First of all, the API does not offer an username/password authentication method for premium users. If a user has a premium account, they add their domain in their control panel on riffly.com, so it will auto-detect any riffs that are played from their domain.

Second, the metadata for riffs is only available though JavaScript. More exactly, imagine you have the ID of a riff: B47686169D7111DC9B0D44CF0D09CCE3. In order to get its metadata you have to read http://riffly.com/api/info/B47686169D7111DC9B0D44CF0D09CCE3, which will give you something like this:

{
  "created" : "1196227339",
  "riffly_id" : "B47686169D7111DC9B0D44CF0D09CCE3",
  "playbacks" : "80",
  "type" : "video"
}
The most useful things here are the created timestamp and the playbacks count. Unfortunatelly, in order to display these in the File Picker, I would have to get these files for each riff and parse them in PHP. I'm not sure it's worth it.

A possible solution is to find the a way to embed some <script> tags in the File Picker that load JavaScript from this address http://riffly.com/api/info/B47686169D7111DC9B0D44CF0D09CCE3?callback=myCallback. The code produced by this address will call the myCallback function. Unfortunatelly, I'm not sure this will work with HTTPS Moodle instalations.

No comments:

Post a Comment