INSERT INTO twitter.status …

Want to start building a Twitter application using YQL? We've recently added a number of new tables to the community table list that provide full read/write access to Twitter's APIs using OAuth. These tables allow you as a developer to interact with Twitter as if it were any other YQL table: Not only can you read from and write to Twitter, but you can easily merge data with other Yahoo! and 3rd-party APIs and web services.

For API endpoints requiring authorization, OAuth signing is done automatically via YQL Execute and HTTPS. All you need to pass through is your consumer key / secret and access token key / secret as keys in your YQL query. That means you no longer need to ask your users for their passwords and there's no reason not to start using OAuth in your Twitter applications. Why should I use OAuth for my applications?

To get started with these new tables, we've got some simple examples:

1. First, set up a new Twitter application. (You'll need your own Consumer Key and Secret for some read/write actions from Twitter)

2. Load the YQL Console with the new tables:
https://developer.yahoo.com/yql/console/?env=store://datatables.org/alltableswithkeys

3. Experiment with the following YQL queries.

a. Get single status:
SELECT * FROM twitter.status WHERE id='8036408424';

b. Get a user:
SELECT * FROM twitter.users WHERE id='mlaaker';

c. Tweet something:
INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
VALUES ('tweeting from yql!', '@your_consumer_key', '@your_consumer_secret', '@your_access_token', '@your_access_secret');

d. Current weather at a tweet's geo-location:
SELECT * from weather.woeid WHERE w in (select woeid from geo.places WHERE text in (select Placemark.address from google.geocoding WHERE q in (SELECT geo.point FROM twitter.status WHERE id="8098940289") LIMIT 1));

With these new tables, we hope to see more interesting Twitter applications built on top of YQL... especially those that integrate other best-of-breed web services. Don't see an API or web service you want? Check out the existing open tables, build your own, and contribute for others to use in their projects.