The Web is your API with YQL
Working with data from the web?

Hate jumping through API hoops?
What we do...
1. Find a good API
2. Sign up for developer key
3. Confirm sign up
4. Find required method
5. Read docs
6. A...
What we want...
1. Find good data
2. Request and filter data
3. Do something with the data
That's where YQL comes in...
(http://developer.yahoo.com/yql/console/)
SELECT    {something}
  FROM    {somewhere}
 WHERE    {conditions}

The web becomes your database

Single URI/end-point

S...
YQL is an open web service

No other Yahoo tools needed

Return data as XML, JSON, JSON-P
Easy to use YQL console

Helps build queries like
https://query.yahooapis.com/v1/public/
yql?q={uri_encoded_query}&
format...
Call service in PHP using cURL

 $yql = 'SELECT * '
      .   'FROM ukgeocode '
      . 'WHERE postcode = "EH5 2GJ"';

 $s...
Not limited to data provided by Yahoo

Community contributed data tables
(http://datatables.org/)


Contribute with defini...
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
   <meta>
      <sam...
http://developer.yahoo.com/yql/
http://github.com/yql/yql-tables/
http://datatables.org/
K THX BYE




  I CAN HAZ QUESTIONS?

   http://maxmanders.co.uk/
http://twitter.com/maxmanders/
Upcoming SlideShare
Loading in …5
×

A Quick Introduction to YQL

2,456 views

Published on

Slides from a talk I gave at Edinburgh Techmeetup on a brief introduction to YQL.

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,456
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A Quick Introduction to YQL

  1. 1. The Web is your API with YQL
  2. 2. Working with data from the web? Hate jumping through API hoops?
  3. 3. What we do... 1. Find a good API 2. Sign up for developer key 3. Confirm sign up 4. Find required method 5. Read docs 6. Authenticate? 7. Read docs again 8. Receive a chunk of data 9. Filter data to make it useful
  4. 4. What we want... 1. Find good data 2. Request and filter data 3. Do something with the data
  5. 5. That's where YQL comes in... (http://developer.yahoo.com/yql/console/)
  6. 6. SELECT {something} FROM {somewhere} WHERE {conditions} The web becomes your database Single URI/end-point Select, Insert, Update and Delete Filter, Sort and Limit
  7. 7. YQL is an open web service No other Yahoo tools needed Return data as XML, JSON, JSON-P
  8. 8. Easy to use YQL console Helps build queries like https://query.yahooapis.com/v1/public/ yql?q={uri_encoded_query}& format={xml|json}& diagnostics={true|false}& callback={function}
  9. 9. Call service in PHP using cURL $yql = 'SELECT * ' . 'FROM ukgeocode ' . 'WHERE postcode = "EH5 2GJ"'; $service = 'http://query.yahooapis.com/v1/public/yql?'; $url = $service . '&q=' . url_encode($yql); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $out = curl_exec($ch); curl_close($ch); print_r($out);
  10. 10. Not limited to data provided by Yahoo Community contributed data tables (http://datatables.org/) Contribute with definition file You can use server-side javascript
  11. 11. <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <sampleQuery>Sample query here</sampleQuery> <author>A. Nother</author> <documentationURL>Tell me more here.</documentationURL> <description>Brief description here.</description> </meta> <bindings> <select itemPath="response.coord" produces="XML"> <urls> <url> http://ukgeocode.maxmanders.co.uk/postcode/{postcode} </url> </urls> <inputs> <key id='postcode' type='xs:string' paramType='path' required="true" /> </inputs> </select> </bindings> </table>
  12. 12. http://developer.yahoo.com/yql/ http://github.com/yql/yql-tables/ http://datatables.org/
  13. 13. K THX BYE I CAN HAZ QUESTIONS? http://maxmanders.co.uk/ http://twitter.com/maxmanders/

×