SELECT * FROM
Internet
Using theYahoo! Query Language
Survey...
Who am I?
• Brian DeShong, Senior TechnicalYahoo
• Yahoo! (Atlanta)
• Developer / sys admin since 1998
• Focus on PHP, ope...
Agenda
• What’sYQL?
• How to work withYQL
• Demos!
• Data available fromY! and others
• Making your data available viaYQL
What isYQL?
How does it work?
• Web service with an SQL-like query syntax
• SQL is familiar to many developers
• Common interface for ...
Working WithYQL
SELECT {what}
FROM {data table}
WHERE {condition}
SQL syntax
SELECT *
FROM weather.forecast
WHERE location = ‘29424’
Weather forecast
SELECT *
FROM ip.location
WHERE ip = ’153.9.243.13’
Location by IP
SELECT from_user, text,
profile_image_url
FROM twitter.search
WHERE q = ’#barcampchs’
Twitter search
More than SELECT
• Modify data with INSERT, UPDATE and DELETE
• Tweet, add blog posts, update databases, etc.
• We’ll look...
Demos!
IntegratingYQL
RESTful API
http://query.yahooapis.com/v1/public/yql
?q=[urlencoded YQL query]
&format=[xml|json|etc.]
Weather URL
https://query.yahooapis.com/v1/public/yql
?q=select%20*%20
from%20weather.location%20
where %20location%3D'294...
PHP
PHP output
brian@roadrunner [~/Dropbox/barcampchs/code]$ php ./twitter.php
XarkGirl: @mguerard need more $$, but loving li...
JavaScript
Data
Yahoo! Data
Community data
Open Data Tables
• Create web service for sites that do not expose
public APIs
• Data table is:
• XML document
• Translate...
Data Table XML example
Storing to Sherpa
• yql.storage and yql.storage.admin tables
• Allows you to store and work with data inYQL itself
• Share...
Sherpa Limits and Reqs
• Size Limit
• 1000 records @ 100KB each
• Retention Limit
• 30 day purge
• Record Format
• Records...
Wrap Up
Why YQL?
• Same interface for all of your data
• Process data away from your application
• Rapidly prototype and build app...
http://developer.yahoo.com/yql/
Thanks!
bdeshong@yahoo-inc.com
http://www.yahoo.com/
brian@deshong.net
http://www.deshong.net/
SELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query Language
Upcoming SlideShare
Loading in …5
×

SELECT * FROM Internet: Using the Yahoo! Query Language

2,251 views

Published on

An introduction to the Yahoo! Query Language; originally presented at BarCamp Charleston on November 13, 2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,251
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SELECT * FROM Internet: Using the Yahoo! Query Language

  1. 1. SELECT * FROM Internet Using theYahoo! Query Language
  2. 2. Survey...
  3. 3. Who am I? • Brian DeShong, Senior TechnicalYahoo • Yahoo! (Atlanta) • Developer / sys admin since 1998 • Focus on PHP, open source • Focusing on native mobile apps lately
  4. 4. Agenda • What’sYQL? • How to work withYQL • Demos! • Data available fromY! and others • Making your data available viaYQL
  5. 5. What isYQL?
  6. 6. How does it work? • Web service with an SQL-like query syntax • SQL is familiar to many developers • Common interface for any data on the web • Query, filter, join and update data across any structured data on the web • Output formats: • XML • JSON, JSONP, JSONPX
  7. 7. Working WithYQL
  8. 8. SELECT {what} FROM {data table} WHERE {condition} SQL syntax
  9. 9. SELECT * FROM weather.forecast WHERE location = ‘29424’ Weather forecast
  10. 10. SELECT * FROM ip.location WHERE ip = ’153.9.243.13’ Location by IP
  11. 11. SELECT from_user, text, profile_image_url FROM twitter.search WHERE q = ’#barcampchs’ Twitter search
  12. 12. More than SELECT • Modify data with INSERT, UPDATE and DELETE • Tweet, add blog posts, update databases, etc. • We’ll look at Open Data Tables shortly
  13. 13. Demos!
  14. 14. IntegratingYQL
  15. 15. RESTful API http://query.yahooapis.com/v1/public/yql ?q=[urlencoded YQL query] &format=[xml|json|etc.]
  16. 16. Weather URL https://query.yahooapis.com/v1/public/yql ?q=select%20*%20 from%20weather.location%20 where %20location%3D'29424'%3B
  17. 17. PHP
  18. 18. PHP output brian@roadrunner [~/Dropbox/barcampchs/code]$ php ./twitter.php XarkGirl: @mguerard need more $$, but loving life. i'm helping w/ #barcampCHS, writing a novel, working on secret project. how the hell iz u?!? barcampchs: RT @csatcofc: Pecha Kucha on Wednesday 10/10, Barcamp on Saturday, 10/13. Next week is going to be good! #pkchs #barcampchs #csatcofc csatcofc: Pecha Kucha on Wednesday 10/10, Barcamp on Saturday, 10/13. Next week is going to be good! #pkchs #barcampchs #csatcofc barcampchs: Cool, just found out that the @lullabot's will be sending someone to join us fm Savannah #barcampchs @chsdug #drupal carnellm: If you haven't bought your ticket for #BarCampCHS yet, you can try to win a free one! http://www.facebook.com/TheModernConnection Peter_Lucash:Vote for my proposal - From Idea to Launch! RT @BarCampCHS: RT @pla1: 8 days until BarCamp Charleston Sat Nov 13 2010 #barcampchs joannepicvu: RT @barcampchs: RT @pla1: 8 days until BarCamp Charleston Sat Nov 13 2010 #barcampchs barcampchs: RT @pla1: 8 days until BarCamp Charleston Sat Nov 13 2010 #barcampchs CBSWebDesigns: #barcampchs is coming up.What sessions do you want ? We hope ours is 1. Customizing WP Twenty Ten theme is one of them. http://t.co/nP5aR99 pla1: 8 days until BarCamp Charleston Sat Nov 13 2010 #barcampchs Yaenette: RT @barcampchs: Only one week left to get your ticket to #barcampchs #chs #nchs carnellm: I'm attending #BarCampCHS! Have you gotten your ticket yet? http://www.eventbrite.com/s/1EXx vhanna26: @Yaenette It will be fun. #barcampchs tybaltknight: I missed the memo on the change of venue for #BarcampCHS planning session #volunteeringfail. vhanna26:At a #barcampchs planning meeting. Only nine more days!!!
  19. 19. JavaScript
  20. 20. Data
  21. 21. Yahoo! Data
  22. 22. Community data
  23. 23. Open Data Tables • Create web service for sites that do not expose public APIs • Data table is: • XML document • TranslatesYQL query into HTTP request • See datatables.org
  24. 24. Data Table XML example
  25. 25. Storing to Sherpa • yql.storage and yql.storage.admin tables • Allows you to store and work with data inYQL itself • Shares tables, environments and JS with all otherYQL users • Layered onYahoo! Sherpa DHT cloud storage platform
  26. 26. Sherpa Limits and Reqs • Size Limit • 1000 records @ 100KB each • Retention Limit • 30 day purge • Record Format • Records must be in a text-based format; authentication for New Records • yql.storage.admin access must be authorized using two-legged OAuth
  27. 27. Wrap Up
  28. 28. Why YQL? • Same interface for all of your data • Process data away from your application • Rapidly prototype and build applications • Create APIs for sites that don’t have them • And let others easily leverage them!
  29. 29. http://developer.yahoo.com/yql/
  30. 30. Thanks! bdeshong@yahoo-inc.com http://www.yahoo.com/ brian@deshong.net http://www.deshong.net/

×