Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (63 sloc) 2.5 KB
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
<meta>
<sampleQuery>insert into {table} (status,username,password) values ("new tweet from YQL", "twitterusernamehere","twitterpasswordhere")</sampleQuery>
<sampleQuery>select * from {table} where id="2108869549" and username="twitterusernamehere" and password="twitterpasswordhere"</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://twitter.com/statuses/show/{id}.xml</url>
</urls>
<inputs>
<key id="username" type="xs:string" required="false" paramType="variable"/>
<key id="password" type="xs:string" required="false" paramType="variable"/>
<key id="id" type="xs:integer" required="true" paramType="path"/>
</inputs>
<execute><![CDATA[
var r = null;
if (username && password) {
y.include("http://yqlblog.net/samples/base64.js");
var authheader = "Basic "+Base64.encode(username+":"+password);
r = request.header("Authorization",authheader).get().response;
} else {
r = request.get().response;
}
response.object = r;
]]></execute>
</select>
<insert itemPath="" produces="XML">
<urls>
<url>http://twitter.com/statuses/update.xml</url>
</urls>
<inputs>
<value id="username" type="xs:string" required="true" paramType="variable"/>
<value id="password" type="xs:string" required="true" paramType="variable"/>
<value id="status" type="xs:string" required="true" paramType="variable"/>
</inputs>
<execute><![CDATA[
y.include("http://yqlblog.net/samples/base64.js");
var authheader = "Basic "+Base64.encode(username+":"+password);
var content = "status="+status;
response.object =
request.header("Authorization",authheader).post(content).response;
]]></execute>
</insert>
<delete itemPath="" produces="XML">
<urls>
<url>http://twitter.com/statuses/destroy/{id}.xml</url>
</urls>
<inputs>
<key id="username" type="xs:string" required="true" paramType="variable"/>
<key id="password" type="xs:string" required="true" paramType="variable"/>
<key id="id" type="xs:string" required="true" paramType="path"/>
</inputs>
<execute><![CDATA[
y.include("http://yqlblog.net/samples/base64.js");
var authheader = "Basic "+Base64.encode(username+":"+password);
response.object =
request.header("Authorization",authheader).del().response;
]]></execute>
</delete>
</bindings>
</table>