Web services made
easy with YQL




Chris&an Heilmann ‐ Global Radio Brown Bag ‐ London, England, June 2010
I am Chris (@codepo8)
I love the web as a
medium.
And I hate taking
unnecessary steps.
So if I want to get
data off the web, I
don’t feel like going
through lots of
steps.
1. Find data API
2. Request key
3. Receive key
4. Find data endpoint
5. Read docs to learn how to
   authenticate
6. Read ...
Instead I want this:
1. Find data
2. Request, filter and
   convert data.
3. Use data.
And for that, I can
use YQL.
YQL       hAp://developer.yahoo.com/yql/console/
YQL       hAp://developer.yahoo.com/yql/console/




     select {what} from {where}
          where {condi&ons}
YQL turns the web
into a massive
database.
You can select,
filter, sort and limit
data and you can
even insert, update
and delete from it.
YQL in itself is a
web service, and
you don’t need any
Yahoo product to
use it.
Using the YQL
console makes it
very easy to use it.
1) Define your Query




              3) Copy the URL.

2) Select your output
Or the manly way...

https://query.yahooapis.com/v1/public/
yql?q={uri-encoded-query}&
format={xml|json}&
diagnostics={tru...
Using the YQL
console makes it
very easy to use it.
You can use JSON-P and just
copy and paste the URL in
JavaScript:
Or create nodes to
do it dynamically.
Display with PHP:
So what about some
demo queries?
select * from
search.web where
query="london
heart"
select abstract from
search.web where
query="london
heart"
select abstract from
search.web(100)
where
query="london
heart"
select * from
search.termextract where
context in (
select abstract from
search.web(100) where
query="london heart"
)
select * from
search.termextract where
context in (
select abstract from
search.web(100) where
query="london heart"
)
| so...
select * from query.multi where queries='
  select Title,Description,Url,DisplayUrl
   from microsoft.bing.web(20) where
q...
http://icant.co.uk/goohoobi/index.php?research
http://vimeo.com/8075850
select * from
flickr.photos.search(
50) where
text="XFM" and
has_geo='true'
select * from
geo.places where
text="glastonbury"
select * from
flickr.photos.search(50) where
woe_id in (select woeid from
geo.places where
text="glastonbury")
select * from
flickr.photos.search(50) where
woe_id in (select woeid from
geo.places where
text="glastonbury") and
min_tak...
I love using
geolocation
services.
http://isithackday.com/hacks/geo/yql-geo-library/
http://isithackday.com/hacks/geo/around-you/
hAp://isithackday.com/geoplanet‐explorer/
<script src="addmap.js"></script>
 <script>
 addmap.config.mapkey = 'YOUR_API_KEY';
 addmap.analyse('content');
 </script>...
YQL is not limited to
Yahoo data - at all.
Articles of the New
 York Times:
select * from nyt.article.search where
query="football"
Headlines of
 elpais.com:
select content from html where url="http://
elpais.com" and xpath="//h2/a"
Keywords extracted
 from elpais.com
 headlines.
select * from search.termextract where
context in(
  select content from h...
elpais.com
 headlines in English:
select * from google.translate where q
in(select content from html where
url="http://elp...
Updating Twitter:
use 'http://www.yqlblog.net/samples/
twitter.status.xml';
insert into twitter.status
(status,username,pa...
Updating
 Wordpress:
insert into wordpress.post
(title, description, blogurl, username,
password)
values
("Test Title", "T...
YQL is open - if you
want your data in
this system, all we
need is an address
where to get it :)
Join us!   http://github.com/yql/yql-tables
You can even write
server-side
JavaScript to build
a webservice that
way.
One last thing to
access through YQL
is the Yahoo
Firehose.
http://developer.yahoo.net/blog/archives/2010/04/
           yahoo_updates_firehose.html
Enough talk, let me
show you YQL.
Christian Heilmann
http://wait-till-i.com        Thanks!
http://developer-evangelism.com
http://twitter.com/codepo8
Web services made easy with YQL
Web services made easy with YQL
Web services made easy with YQL
Upcoming SlideShare
Loading in …5
×

Web services made easy with YQL

3,680 views

Published on

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

No Downloads
Views
Total views
3,680
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
41
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Web services made easy with YQL

  1. 1. Web services made easy with YQL Chris&an Heilmann ‐ Global Radio Brown Bag ‐ London, England, June 2010
  2. 2. I am Chris (@codepo8)
  3. 3. I love the web as a medium.
  4. 4. And I hate taking unnecessary steps.
  5. 5. So if I want to get data off the web, I don’t feel like going through lots of steps.
  6. 6. 1. Find data API 2. Request key 3. Receive key 4. Find data endpoint 5. Read docs to learn how to authenticate 6. Read docs to know what parameters you have. 7. Get massive amount of data in some obscure format 8. Use data after converting and filtering it.
  7. 7. Instead I want this:
  8. 8. 1. Find data 2. Request, filter and convert data. 3. Use data.
  9. 9. And for that, I can use YQL.
  10. 10. YQL     hAp://developer.yahoo.com/yql/console/
  11. 11. YQL     hAp://developer.yahoo.com/yql/console/ select {what} from {where}  where {condi&ons}
  12. 12. YQL turns the web into a massive database.
  13. 13. You can select, filter, sort and limit data and you can even insert, update and delete from it.
  14. 14. YQL in itself is a web service, and you don’t need any Yahoo product to use it.
  15. 15. Using the YQL console makes it very easy to use it.
  16. 16. 1) Define your Query 3) Copy the URL. 2) Select your output
  17. 17. Or the manly way... https://query.yahooapis.com/v1/public/ yql?q={uri-encoded-query}& format={xml|json}& diagnostics={true|false}& callback={function}& env=store%3A%2F%2Fdatatables.org %2Falltableswithkeys
  18. 18. Using the YQL console makes it very easy to use it.
  19. 19. You can use JSON-P and just copy and paste the URL in JavaScript:
  20. 20. Or create nodes to do it dynamically.
  21. 21. Display with PHP:
  22. 22. So what about some demo queries?
  23. 23. select * from search.web where query="london heart"
  24. 24. select abstract from search.web where query="london heart"
  25. 25. select abstract from search.web(100) where query="london heart"
  26. 26. select * from search.termextract where context in ( select abstract from search.web(100) where query="london heart" )
  27. 27. select * from search.termextract where context in ( select abstract from search.web(100) where query="london heart" ) | sort(field="Result") | unique(field="Result")
  28. 28. select * from query.multi where queries=' select Title,Description,Url,DisplayUrl from microsoft.bing.web(20) where query="cat"; select title,clickurl,abstract,dispurl from search.web(20) where query="cat"; select titleNoFormatting,url,content,visibleUrl from google.search(20) where q="cat" '
  29. 29. http://icant.co.uk/goohoobi/index.php?research
  30. 30. http://vimeo.com/8075850
  31. 31. select * from flickr.photos.search( 50) where text="XFM" and has_geo='true'
  32. 32. select * from geo.places where text="glastonbury"
  33. 33. select * from flickr.photos.search(50) where woe_id in (select woeid from geo.places where text="glastonbury")
  34. 34. select * from flickr.photos.search(50) where woe_id in (select woeid from geo.places where text="glastonbury") and min_taken_date = "2009"
  35. 35. I love using geolocation services.
  36. 36. http://isithackday.com/hacks/geo/yql-geo-library/
  37. 37. http://isithackday.com/hacks/geo/around-you/
  38. 38. hAp://isithackday.com/geoplanet‐explorer/
  39. 39. <script src="addmap.js"></script> <script> addmap.config.mapkey = 'YOUR_API_KEY'; addmap.analyse('content'); </script> hAp://isithackday.com/hacks/geo/addmap.html
  40. 40. YQL is not limited to Yahoo data - at all.
  41. 41. Articles of the New York Times: select * from nyt.article.search where query="football"
  42. 42. Headlines of elpais.com: select content from html where url="http:// elpais.com" and xpath="//h2/a"
  43. 43. Keywords extracted from elpais.com headlines. select * from search.termextract where context in( select content from html where url="http://elpais.com" and xpath="//h2/a" )
  44. 44. elpais.com headlines in English: select * from google.translate where q in(select content from html where url="http://elpais.com" and xpath="//h2/a") and target="en"
  45. 45. Updating Twitter: use 'http://www.yqlblog.net/samples/ twitter.status.xml'; insert into twitter.status (status,username,password) values ( "In your redinnova, blowing ur mindz", "codepo8", "didyoureallythinkIshowit?" )
  46. 46. Updating Wordpress: insert into wordpress.post (title, description, blogurl, username, password) values ("Test Title", "This is a test body", "http://ajaxian.com", "codepo8", "iedoesitright")
  47. 47. YQL is open - if you want your data in this system, all we need is an address where to get it :)
  48. 48. Join us! http://github.com/yql/yql-tables
  49. 49. You can even write server-side JavaScript to build a webservice that way.
  50. 50. One last thing to access through YQL is the Yahoo Firehose.
  51. 51. http://developer.yahoo.net/blog/archives/2010/04/ yahoo_updates_firehose.html
  52. 52. Enough talk, let me show you YQL.
  53. 53. Christian Heilmann http://wait-till-i.com Thanks! http://developer-evangelism.com http://twitter.com/codepo8

×