Skip to content

Instantly share code, notes, and snippets.

@jimpick
Created April 30, 2009 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimpick/104273 to your computer and use it in GitHub Desktop.
Save jimpick/104273 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
<meta>
<author>Jim Pick</author>
<documentationURL>http://gist.github.com/gists/104273/</documentationURL>
</meta>
<bindings>
<select itemPath="" produces="XML" >
<urls>
<url env="all">http://spreadsheets.google.com/feeds/cells/pUetVbUnXgLbDjatWZKjVAw/1/private/values</url>
</urls>
<paging model="offset">
<start id="start_index" default="0" />
<pagesize id="max_results" max="100" />
<total default="10" />
</paging>
<inputs>
<key id="min-row" type="xs:string" paramType="query" const="true" private="true" default="7"/>
<key id="min-col" type="xs:string" paramType="query" const="true" private="true" default="2"/>
<key id="max-col" type="xs:string" paramType="query" const="true" private="true" default="2"/>
<key id="ck" type="xs:string" paramType="variable" required="true" default="45c53f8...d5f645"/>
<key id="cks" type="xs:string" paramType="variable" required="true" default="45c53f8...d5f645"/>
</inputs>
<execute><![CDATA[
// 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: cks, tokenSecret: ""};
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 {
// get the content from service along with the OAuth header, and return the result back out
response.object = request.contentType('application/xml').header("Authorization", OAuth.getAuthorizationHeader("netflix.com", message.parameters)).get().response;
} catch(err) {
response.object = {'result':'failure', 'error': err};
}
]]></execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment