YQL how to build an application
description
Transcript of YQL how to build an application
![Page 1: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/1.jpg)
YQL how to build an application
L. Grewe
![Page 2: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/2.jpg)
YQL – what is itYahoo! Query Language
![Page 3: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/3.jpg)
Make Applications – Mashups with YQLTake data from a service on the web (or your
own data) and access it through YQL.
Take this data an use it in an application of your own making
Example: Take some News like Yahoo! News and put in in your application and place it in a Google Map
![Page 4: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/4.jpg)
Some Examples
![Page 5: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/5.jpg)
More
![Page 6: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/6.jpg)
Mashup IdeaDeveloper must connect to different web
services
![Page 7: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/7.jpg)
Mashup Idea Without YQL –must write code to each
![Page 8: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/8.jpg)
Problems ???Well each API is different, you have to learn
each and get different kinds of output formats you have to parse.
SOLUTION?YQL can wrap the requests in a SQL/
database like requestYQL can return results in JSON or XML
![Page 9: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/9.jpg)
YQL Mashup
![Page 10: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/10.jpg)
YQL is like database language SQL
![Page 11: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/11.jpg)
YQL application mashupApplication = Data from a web service(s) + Display/Visualization + Any additional functionality
![Page 12: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/12.jpg)
YQL looks like SQLLeverages the fact that many web application
developers know SQL.YQL looks like SQL
example getting photos from flickr using YQL becomes
select * from flickr.photos.search where text='cat'
Translating a text to French becomes using YQL:
select * from google.translate where q='hubcap' and target='fr'
You can also mix and match different sources, for example you can get the latest headlines from yahoo’s top stories and translate them to French:
select * from google.translate where target='fr' and q in (select title from rss where url='http://rss.news.yahoo.com/rss/topstories')
![Page 13: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/13.jpg)
Why YQL?Thousands of Web Services that are usefulEach has its own API –lots to learn and
maintainYQL can do this as well as promote
combining, shaping data that is received from these web services
![Page 14: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/14.jpg)
YQL Statementshow: lists supported tablesdesc: describes structure of tableselect: fetches datause: use a Open Data Table
![Page 15: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/15.jpg)
YQL Select statement
SELECT whatFROM collectionWHERE filter condition IN (sub-select)LIMIT n OFFSET n
![Page 16: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/16.jpg)
YQL accessWe submit YQL statements through the web. Example:SELECT * FROM flickr.photos.search WHERE text="cat"
To access the YQL Web Service, a Web application can call HTTP GET, passing the YQL statement as a URL parameter, for example:
http://query.yahooapis.com/v1/public/yql?q=SELECT * FROM flickr.photos.search WHERE text="Cat"
Here are the results of typing in the above URL in a browser....this is the 10 videos at that moment for cats on flicker:
<query yahoo:count="9" yahoo:created="2011-02-18T19:54:58Z" yahoo:lang="en-US">
<results><photo farm="6" id="5456857132" isfamily="0" isfriend="0" ispublic="1" owner="66972807@N00" secret="0158d7bdba" server="5131" title="Still Life With
New Clock"/><photo farm="6" id="5456241213" isfamily="0" isfriend="0" ispublic="1" owner="47372746@N00" secret="2f1877fed0" server="5216" title="RIP Frodo: 1995 -
2011"/><photo farm="6" id="5456252599" isfamily="0" isfriend="0" ispublic="1" owner="20846638@N04" secret="5879cee952" server="5252" title="A Hairless Cat's
Ear?"/><photo farm="6" id="5456251657" isfamily="0" isfriend="0" ispublic="1" owner="32276183@N00" secret="5343a104c2" server="5215" title="Clare and
Dora"/><photo farm="6" id="5456246703" isfamily="0" isfriend="0" ispublic="1" owner="92349717@N00" secret="d482c055ae" server="5255" title="Just another lazy
day... in my favorite sunny spot"/><photo farm="6" id="5456850878" isfamily="0" isfriend="0" ispublic="1" owner="32276183@N00" secret="c0b90c636b" server="5131" title="Clare and Dora"/><photo farm="6" id="5456252359" isfamily="0" isfriend="0" ispublic="1" owner="7604309@N06" secret="ca3e2af9a4" server="5134" title="Weird ass cats"/><photo farm="6" id="5456238607" isfamily="0" isfriend="0" ispublic="1" owner="78394733@N00" secret="c5ba2b11de" server="5298" title="Smoke"/><photo farm="6" id="5456235155" isfamily="0" isfriend="0" ispublic="1" owner="78394733@N00" secret="15a551e55e" server="5175" title="Smoke"/></results></query>
What now --- you need to know how to use this information from Flickr to bring up the actual images.
![Page 17: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/17.jpg)
YQL Access pointsPublic Endpointhttp://query.yahooapis.com/v1/yql?q=*****
Oauth Endpoint (requires authentication)http://query.qyahooapis.com/v1/public/yql?q=***
YQL Console (testing)http://developer.yahoo.com/yal/console
![Page 18: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/18.jpg)
YQL --- you can create a table for your own personal Web Service Great way to make it easy for YQL developers
to use your web service.
See Yahoo! YQL website for details.
![Page 19: YQL how to build an application](https://reader035.fdocuments.in/reader035/viewer/2022062222/5681685e550346895ddea1f8/html5/thumbnails/19.jpg)
What is missing? How to display the returned informationHow you visualize that data Use HTML, CSSUSE Javascript / AJAX to make the call to
YQL and get back the data and process it and display it dynamically
Something else from Yahoo! for helping with visualization ---loot at YUI