Permalink
Browse files

Merge pull request #342 from mattes/master

return skype status for user
  • Loading branch information...
2 parents 82d5527 + c18d017 commit d9ec98d1dc4cd8cae28768e9763fda23ceb59d70 @pjdonnelly pjdonnelly committed Mar 27, 2013
Showing with 30 additions and 0 deletions.
  1. +30 −0 skype/skype.user.status.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
+ <meta>
+ <author>Matthias Kadenbach, http://matthiaskadenbach.de</author>
+ <description>return skype status (requires the skype privacy setting set to true)</description>
+ <documentationURL>https://gist.github.com/mattes/5253271</documentationURL>
+ <sampleQuery>select * from {table} where user='mkadenbach'</sampleQuery>
+ </meta>
+ <bindings>
+ <select produces="JSON">
+ <urls>
+ <url>http://mystatus.skype.com/{user}.xml</url>
+ </urls>
+ <inputs>
+ <key id="user" type="xs:string" paramType="path" required="true"/>
+ </inputs>
+ <execute>
+ <![CDATA[
+ var result = y.xmlToJson(request.get().response)["RDF"]["Status"];
+ var lang = {};
+ for(var i=0; i < result["presence"].length; i++) {
+ if(result["presence"][i]["lang"] !== "NUM")
+ lang[ result["presence"][i]["lang"] ] = result["presence"][i]["content"];
+ }
+ response.object = {"status": result["statusCode"]["content"], "message": lang};
+ ]]>
+ </execute>
+ </select>
+ </bindings>
+</table>

0 comments on commit d9ec98d

Please sign in to comment.