Skip to content

Commit

Permalink
adding ymsgr table
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Pullara <spullara@yahoo.com>
  • Loading branch information
sh1mmer authored and spullara committed May 12, 2009
1 parent 151ea91 commit 63e44f4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions ymsgr/ymsgr_status.xml
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<sampleQuery>select * from {table} where u='joemplumber';</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://opi.yahoo.com/online?m=t</url>
</urls>
<inputs>
<key id='u' type='xs:string' paramType='query' required="true" />
</inputs>
<execute><![CDATA[
url = request.url;
var myReq = y.rest(url);
//get plain text back from OPI endpoint
rawStatus = myReq.get().response;
//check if users is not offline
if (!rawStatus.match("NOT ONLINE")) {
status = "online";
} else {
status = "offline";
}
//return results as XML
response.object =
<messengerstatus>
<yahoo_id>{u}</yahoo_id>
<status>{status}</status>
</messengerstatus>
]]></execute>
</select>
</bindings>
</table>




0 comments on commit 63e44f4

Please sign in to comment.