Welcome, guest Sign In

Yahoo! Developer Network Blog

« Previous | Main | Next »


February 8, 2010

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.

Zach Graves
Product Design Developer

Posted at February 8, 2010 7:21 AM | Permalink

Bookmark this on Delicious

Comments

thank u

Posted by: akeel at May 23, 2010 4:31 PM

Post a comment

Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.

Remember Me?

Subscribe

YDN Blog: Get Yahoo! Developer Network Blog on your personalized My Yahoo! home page.

Add To My RSS Feed

YDN Link Blog: Get Yahoo! Developer Network Linkblog on your personalized My Yahoo! home page.

Add To My RSS Feed

Recent Readers

YDN Libraries & Best Practices

  • ASTRA
  • Design Pattern Library
  • Exceptional Performance
  • Yahoo! User Interface Library (YUI)

Copyright © 2010 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy | Terms of Use

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions