Permalink
Browse files

yahoo boss v2 yql table

  • Loading branch information...
1 parent 6d3ebc7 commit dafbb1648360bd826dbbe3b3f19072fd4653b35e @spullara committed Apr 12, 2011
Showing with 61 additions and 0 deletions.
  1. +61 −0 boss/boss.search.xml
View
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="false">
+<meta>
+ <author>Sam Pullara (Assisted by TableSaw)</author>
+ <description/>
+ <documentationURL></documentationURL>
+ <sampleQuery>select * from {table} where q="sam pullara";</sampleQuery>
+</meta>
+<execute><![CDATA[
+var document = {getElementsByTagName:function(value) { return null; }};
+// Include the OAuth libraries from oauth.net
+y.include("http://oauth.googlecode.com/svn/code/javascript/oauth.js");
+y.include("http://oauth.googlecode.com/svn/code/javascript/sha1.js");
+
+// Collect all the parameters
+var encodedurl = request.url;
+var accessor = { consumerSecret:secret, tokenSecret:""};
+]]></execute>
+<bindings>
+ <select produces="XML">
+ <urls>
+ <url>http://yboss.yahooapis.com/ysearch/{service}</url>
+ </urls>
+ <inputs>
+ <key id="service" type="xs:string" paramType="path" default='web'/>
+ <key id="ck" type="xs:string" paramType="variable" required="true"/>
+ <key id="secret" type="xs:string" paramType="variable" required="true"/>
+ <key id="q" paramType="query" required="true"/>
+ <key id="start" paramType="query"/>
+ <key id="count" paramType="query"/>
+ <key id="market" paramType="query"/>
+ <key id="format" paramType="query" default="xml"/>
+ <key id="sites" paramType="query"/>
+ <key id="filter" paramType="query"/>
+ <key id="abstract" paramType="query"/>
+ <key id="type" paramType="query"/>
+ <key id="view" paramType="query"/>
+ <key id="title" paramType="query"/>
+ <key id="url" paramType="query"/>
+ </inputs>
+ <execute>
+<![CDATA[
+var message = { action: encodedurl, method: "GET", parameters: [["oauth_consumer_key",ck],["oauth_version","1.0"]]};
+OAuth.setTimestampAndNonce(message);
+
+// Sign the request
+OAuth.SignatureMethod.sign(message, accessor);
+
+try {
+ // PUT the content to the service along with the OAuth header
+ response.object = request
+ .header("Authorization", OAuth.getAuthorizationHeader("yahooapis.net", message.parameters))
+ .get().response;
+} catch(err) {
+ response.object = {'result':'failure', 'error': err};
+}
+ ]]>
+ </execute>
+ </select>
+</bindings>
+</table>

0 comments on commit dafbb16

Please sign in to comment.