Query the web with YQL
-
Upload
ramace -
Category
Technology
-
view
456 -
download
7
description
Transcript of Query the web with YQL
![Page 1: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/1.jpg)
Query the Web with YQL
Sriram Viswanathanhttp://slideshare.net/ramace
![Page 2: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/2.jpg)
• Similar to SQL
• Can query, filter and join data across Web services
What is YQL?
![Page 3: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/3.jpg)
• Simple, SQL-like
• Hides complexity of Web service API
• Pre-defined tables for popular Yahoo! Web services such as
Flickr, Social and others.
• Supports output format XML, JSON
Why YQL?
![Page 4: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/4.jpg)
• http://developer.yahoo.com/yql/console/
• Enables you to run YQL statements interactively from your
browser
YQL Console
![Page 5: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/5.jpg)
• SELECT what FROM table WHERE filter
Examples
• select * from social.connections where owner_guid=me
• select contactId from social.connections where owner_guid=me
• select image.imageUrl from social.profile where guid=me
SELECT statement
![Page 6: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/6.jpg)
Examples
•select * from flickr.photos.search where text='Barcelona’ and
api_key=‘your api key’
•select * from upcoming.events where location in ("San Francisco",
"San Jose”)
•select * from flickr.photos.info where photo_id='7640771676' and
api_key=’your api key'
Filtering Query Results
![Page 7: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/7.jpg)
Example
select * from social.profile where guid in (select guid from
social.connections where owner_guid=me)
Joining tables with sub-select
![Page 8: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/8.jpg)
• select * from flickr.photos.search where text="Cat" and
api_key=”your api key" limit 10
• select * from flickr.photos.search(0,10) where text="Cat" and
api_key=”you api key”
• select * from flickr.photos.search(0,10) where text="Cat" and
api_key=“you api key” limit 5
• select * from flickr.photos.search where text="Cat" and
api_key=“you api key” limit 5 offset 3
Paging and Limits
![Page 9: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/9.jpg)
• YQL console includes a simple query builder tool. This tool
allows you to customize and explore YQL statements.
Using Query Builder
![Page 10: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/10.jpg)
• Supported response XML, JSON
• Contains diagnostic and results elements
<query ... (attributes such as count)>
<diagnostics>
... (sub-elements such as publiclyCallable)
<results>
... (data returned by the call to YQL)
</results>
</query>
Response Data
![Page 11: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/11.jpg)
• YUI YQL Utility for Javascript
http://yuilibrary.com/yui/docs/yql/
• YQL call from PHP
http://developer.yahoo.com/yql/guide/yql-code-
examples.html#yql_php
YQL using Javascript and PHP
![Page 12: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/12.jpg)
• YQL has a performance uptime target of over 99.5%.
• YQL relies on the correct operation of the Web services and
content providers it accesses.
• Per application limit (identified by your Access Key): 100,000
calls per day.
• Per IP limits: /v1/public/*: 2,000 calls per hour; /v1/yql/*: 20,000
calls per hour.
• YQL rate limits are subject to the rate limits of other Yahoo! and
3rd-party Web services.
Usage Information and Limitations
![Page 13: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/13.jpg)
http://developer.yahoo.com/yql/
http://developer.yahoo.com/yql/guide/
http://yuilibrary.com/yui/docs/yql/
http://developer.yahoo.com/yql/guide/yql-code-
examples.html#yql_php
References
![Page 14: Query the web with YQL](https://reader035.fdocuments.us/reader035/viewer/2022081518/54bd61c54a7959a9278b45c0/html5/thumbnails/14.jpg)
Thank You!&
happy hacking