Skip to content

Commit

Permalink
Adding bit.ly v3 API methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaaker committed Oct 20, 2010
2 parents 08fbc87 + 28c37cf commit 01f52ed
Show file tree
Hide file tree
Showing 125 changed files with 5,173 additions and 1,134 deletions.
24 changes: 23 additions & 1 deletion amazon/amazon.ecs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
default="ItemSearch"/>
<key id="Keywords" type="xs:string" paramType="query" required="true"/>
<key id="AWSAccessKeyId" type="xs:string" paramType="query" required="true"/>
<key id="secret" type="xs:string" paramType="variable" required="true"/>
<key id="SearchIndex" type="xs:string" paramType="query" required="false"
default="Books"/>
<key id="ResponseGroup" type="xs:string" paramType="query" required="false"/>
Expand All @@ -200,6 +201,27 @@
response.object = y.rest(signeduri).get().response;
]]></execute>
</select>
<select itemPath="ItemLookupResponse.Items.Item" produces="XML">
<urls>
<url>http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService</url>
</urls>
<inputs>
<key id="Operation" type="xs:string" paramType="query" required="false"
default="ItemLookup"/>
<key id="ItemId" type="xs:string" paramType="query" required="true"/>
<key id="MerchantId" type="xs:string" paramType="query" required="false"/>
<key id="AWSAccessKeyId" type="xs:string" paramType="query" required="true"/>
<key id="secret" type="xs:string" paramType="variable" required="true"/>
<key id="ResponseGroup" type="xs:string" paramType="query" required="false"/>
<key id="AssociateTag" type="xs:string" paramType="query" required="false"/>
<key id="Sort" type="xs:string" paramType="query" required="false"/>
<key id="Version" type="xs:string" paramType="query" required="false"
default="2009-03-31"/>
</inputs>
<execute><![CDATA[
var signeduri = getSignedURL(request.url, AWSAccessKeyId, secret);
response.object = y.rest(signeduri).get().response;
]]></execute>
</select>
</bindings>
</table>

28 changes: 0 additions & 28 deletions answers/answers.getbycategory.xml

This file was deleted.

27 changes: 0 additions & 27 deletions answers/answers.getbyuser.xml

This file was deleted.

20 changes: 0 additions & 20 deletions answers/answers.getquestion.xml

This file was deleted.

31 changes: 0 additions & 31 deletions answers/answers.search.xml

This file was deleted.

21 changes: 21 additions & 0 deletions arxiv/arxiv.search.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Christian Heilmann</author>
<documentationURL>http://arxiv.org/help/api/index</documentationURL>
<sampleQuery>select * from {table} where search_query="all:electron"</sampleQuery>
</meta>
<bindings>
<select itemPath="feed.entry" produces="XML">
<urls>
<url><![CDATA[http://export.arxiv.org/api/query]]></url>
</urls>
<inputs>
<key id='search_query' type='xs:string' paramType='query' />
<key id='start' type='xs:string' paramType='query' />
<key id='max_results' type='xs:string' paramType='query' />
</inputs>
</select>
</bindings>
</table>

17 changes: 17 additions & 0 deletions basecamp/basecamp.account.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<table https="true" xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<bindings>
<select produces="XML">
<urls>
<url>http://{company}.basecamphq.com/account.xml</url>
</urls>
<inputs>
<key id="company" paramType="path" required="true"/>
<key id="apikey" paramType="variable" required="true"/>
</inputs>
<execute><![CDATA[
response.object = request.header("Authorization", y.crypto.encodeBase64(apikey + ":X")).get().response;
]]></execute>
</select>
</bindings>
</table>
18 changes: 18 additions & 0 deletions basecamp/basecamp.me.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<table https="true" xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<bindings>
<select produces="XML">
<urls>
<url>http://{company}.basecamphq.com/me.xml</url>
</urls>
<inputs>
<key id="company" paramType="path" required="true"/>
<key id="username" paramType="variable" required="true"/>
<key id="password" paramType="variable" required="true"/>
</inputs>
<execute><![CDATA[
response.object = request.header("Authorization", y.crypto.encodeBase64(username + ":" + password)).get().response;
]]></execute>
</select>
</bindings>
</table>
87 changes: 87 additions & 0 deletions bbc/bbc.goodfood.seasonal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Document : bbc.goodfood.seasonal.xml
Created on : May 9, 2010, 6:00 PM
Author : rob
Description:
Purpose of the document follows.
-->

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Rob Young</author>
<sampleQuery>USE "http://www.roryoung.co.uk/bbc.goodfood.seasonal.xml" as bbc.goodfood.seasonal; SELECT * FROM bbc.goodfood.seasonal;</sampleQuery>
<documentationURL></documentationURL>
</meta>
<bindings>
<select itemPath="" produces="JSON">
<urls>
<url>http://www.bbcgoodfood.com/content/local/seasonal/table</url>
</urls>
<inputs>
<key id="foodtype" type="xs:string" paramType="variable"/>
</inputs>
<execute><![CDATA[
var url = "http://www.bbcgoodfood.com/content/local/seasonal/table";
if (foodtype != undefined) {
url += "/" + foodtype;
}
var xpath = '//div[@id="content"]/table/tbody/tr';
var query = y.query("SELECT * FROM html WHERE url=@url AND xpath=@xpath", {url: url, xpath: xpath});
var results = <results></results>;
for each(var result in query.results.tr) {
var my_result = <result/>;
my_result.appendChild(<name>{result.th.a.text()}</name>);
my_result.@href = result.th.a.@href;
var monthResults = new Array();
for (var i in result.td) {
if (result.td[i].img.@alt.length() > 0) {
if (result.td[i].img.@alt.substring(0, 9) == "coming in") {
monthResults.push(1);
} else {
monthResults.push(2);
}
} else {
monthResults.push(0);
}
}
var previous = null;
var foundComing = false;
var foundBestIn = false;
var foundBestOut = false;
for (var i in monthResults) {
if (previous != null && monthResults[i] != previous) {
if (monthResults[i] == 1) {
foundComing = true;
my_result.appendChild(<comingInFrom>{i}</comingInFrom>);
} else if(monthResults[i] == 2) {
foundBestIn = true;
my_result.appendChild(<atItsBestFrom>{i}</atItsBestFrom>);
} else if(monthResults[i] == 0 && previous == 2) {
foundBestOut = true;
my_result.appendChild(<atItsBestUntil>{i-1}</atItsBestUntil>);
}
}
previous = monthResults[i];
}
if (!foundComing) {
my_result.appendChild(<comingInFrom>0</comingInFrom>);
}
if (!foundBestIn) {
my_result.appendChild(<atItsBestFrom>0</atItsBestFrom>);
}
if (!foundBestOut) {
my_result.appendChild(<atItsBestUntil>11</atItsBestUntil>);
}
results.appendChild(my_result);
}
response.object = results;
]]></execute>
</select>
</bindings>
</table>
23 changes: 23 additions & 0 deletions bitly/bit.ly.authenticate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Micah Laaker (micah@laaker.com)</author>
<description>Bit.ly Authenticate</description>
<documentationURL>http://code.google.com/p/bitly-api/wiki/ApiDocumentation</documentationURL>
<sampleQuery>select * from {table} where login='yourlogingoeshere' and apiKey='yourkeygoeshere' and x_login='youruserslogingoeshere' and x_password='youruserspwdgoeshere';</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://api.bit.ly/v3/authenticate</url>
</urls>
<inputs>
<key id="login" type="xs:string" paramType="query" required="true"/>
<key id="apiKey" type="xs:string" paramType="query" required="true"/>
<key id="x_login" type="xs:string" paramType="query" required="true"/>
<key id="x_password" type="xs:string" paramType="query" required="true"/>
<key id="format" type="xs:string" paramType="query" default="xml"/>
</inputs>
</select>
</bindings>
</table>
22 changes: 22 additions & 0 deletions bitly/bit.ly.bitly_pro_domain.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Micah Laaker (micah@laaker.com)</author>
<description>Bit.ly URL Pro Domain</description>
<documentationURL>http://code.google.com/p/bitly-api/wiki/ApiDocumentation</documentationURL>
<sampleQuery>select * from {table} where x_login='yourlogingoeshere' and x_apiKey='yourkeygoeshere' and domain='m13.me';</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://api.bit.ly/v3/bitly_pro_domain</url>
</urls>
<inputs>
<key id="login" type="xs:string" paramType="query" required="true"/>
<key id="apiKey" type="xs:string" paramType="query" required="true"/>
<key id="format" type="xs:string" paramType="query" default="xml"/>
<key id="domain" type="xs:string" paramType="query" required="true"/>
</inputs>
</select>
</bindings>
</table>
23 changes: 23 additions & 0 deletions bitly/bit.ly.clicks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Micah Laaker (micah@laaker.com)</author>
<description>Bit.ly URL Shorten</description>
<documentationURL>http://code.google.com/p/bitly-api/wiki/ApiDocumentation</documentationURL>
<sampleQuery>select * from {table} where login='yourlogingoeshere' and apiKey='yourkeygoeshere' and hash='a4MSUH';</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://api.bit.ly/v3/clicks</url>
</urls>
<inputs>
<key id="login" type="xs:string" paramType="query"/>
<key id="apiKey" type="xs:string" paramType="query"/>
<key id="format" type="xs:string" paramType="query" default="xml"/>
<key id="shortUrl" type="xs:string" paramType="query"/>
<key id="hash" type="xs:string" paramType="query"/>
</inputs>
</select>
</bindings>
</table>
23 changes: 23 additions & 0 deletions bitly/bit.ly.clicks_by_day.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Micah Laaker (micah@laaker.com)</author>
<description>Bit.ly URL Clicks by Day</description>
<documentationURL>http://code.google.com/p/bitly-api/wiki/ApiDocumentation</documentationURL>
<sampleQuery>select * from {table} where login='yourlogingoeshere' and apiKey='yourkeygoeshere' and hash='a4MSUH';</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://api.bit.ly/v3/clicks_by_day</url>
</urls>
<inputs>
<key id="login" type="xs:string" paramType="query"/>
<key id="apiKey" type="xs:string" paramType="query"/>
<key id="format" type="xs:string" paramType="query" default="xml"/>
<key id="shortUrl" type="xs:string" paramType="query"/>
<key id="hash" type="xs:string" paramType="query"/>
</inputs>
</select>
</bindings>
</table>
Loading

0 comments on commit 01f52ed

Please sign in to comment.