Pages: [1]   Go Down
Author Topic: Sending to Twitter via YQL  (Read 606 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may have heard of YQL, Yahoo's SQL query language for the web (http://developer.yahoo.com/yql/). Yesterday it was updated to allow insert, delete and Update.  
The example shows a simple one line way of updating twitter status that make it look easy to do.  I want to have a go
using the Arduino to send YQL statements  to update a twitter status.  However it's not quite as easy as it looks:

1: The example uses HTTPS to securely send the password.  As we know the Arduino can not easily handle HTTPS
The example Open DataTable is here:
http://developer.yahoo.com/yql/guide/yql-iud-examples.html#yql-iud-example-twitter

2: The URL for YQL is full of characters that need to be encoded before they can be sent.

To solve these:

1: You need to change the table definition to not insist on HTTPS.  This is no more dangerous than the current arduino implementations of the Twitter interface
An example Open table with the correct definition is here:

http://ac22002-09.computing.dundee.ac.uk/student0803/OpenDataTables/Twitter.Status.xml

Make a copy of this and store it on your server. Use the same name, it actually defines the database and table to YSQL

To send Twitter update the following needs to be sent to YQL

use 'http://ac22002-09.computing.dundee.ac.uk/student0803/OpenDataTables/twitter.status.xml';
insert into twitter.status (status,username,password) values (\"Sending from Arduino via YSQL\", \"andycobley\",\"*****\")

The first line tells YQL to use the Open Table definition you have stored on your server (this one is mine and might disappear)
The second line does the YQL insert.  You'll need to set the password and account name of course

These commands have to be sent as a HTTP PUT command, properly encoded.  In the example code the Send method  encodes the above into the proper HTTP form.

Full example code here:

http://hackday.computing.dundee.ac.uk:8080/YQLTwitterPost/YQLTwitterPost.pde

See the YQL page for more details. http://developer.yahoo.com/yql/

Andy C
Not part of Yahoo!
Logged

Pages: [1]   Go Up
Jump to: