Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d85e325d18
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (48 sloc) 2.071 kb
<?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>http://help.simplegeo.com/faqs/api-documentation/endpoints</documentationURL>
<sampleQuery>select * from {table} where ck=@ck and secret=@secret and lat='37.335088' and lon='-122.067204';</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="JSON">
<urls>
<url>http://api.simplegeo.com/{version}/nearby/address/{lat},{lon}.json</url>
</urls>
<inputs>
<key id="version" type="xs:string" paramType="path" default='0.1'/>
<key id="lat" type="xs:string" paramType="path" required="true"/>
<key id="lon" type="xs:string" paramType="path" required="true"/>
<key id="ck" type="xs:string" paramType="variable" required="true"/>
<key id="secret" type="xs:string" paramType="variable" required="true"/>
</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("api.simplegeo.com", message.parameters))
.get().response;
} catch(err) {
response.object = {'result':'failure', 'error': err};
}
]]>
</execute>
</select>
</bindings>
</table>
Jump to Line
Something went wrong with that request. Please try again.