+    YQL          Durga Sankari          Yahoo! Labs
+    Agenda        YQL Overview        Making Queries and the Console        Different ways of using YQL
+                Data manipulation    Hacks   =                        +                 Data visualization
+    Web has lots of Data around
+    Yahoo! has also opened up     its data.
+    http://developer.yahoo.com/everything.html
+    The trouble with data        You need to find data API        Get Access – Signup for key        Find data endpoin...
+    To make data access     easy on the web, Yahoo!     created YQL
+        YQL turns webservices and data on the web into databases.        YQL lets you access almost all API s in a stan...
+ PI List on consoleA               Yahoo! Developer Network
+    select {what} from {where} where    {conditions}                     Yahoo! Developer Network
+    You can select, filter,sort and limit data     and you can even insert,update and     delete from it.
+http://developer.yahoo.com/yql/console
+    Finding Videos about IIT-KGP    SELECT * FROM youtube.search where     query= IIT Kharagpur
+        SELECT * FROM twitter.search WHERE q=hacku        SELECT * FROM twitter.search WHERE q=hacku Limit 5        IN...
+    Accessing Private Data        http://query.yahooapis.com/v1/yql        Uses OAuth 1.0 for authorization        OAu...
+                            YQL in HTML    <html>    <head>    <title>YUI in YQL</title>    <script src="http://yui.yahoo...
+                          USE YQL IN PHP    <?php    //Code to access YQL using PHP    $yql_query = "SELECT * FROM upcomi...
+               USE YQL IN JAVASCRIPT        YUI().use(node, gallery-yql, function(Y) {     // Specify the YQL query     ...
+    THANK YOU
Upcoming SlideShare
Loading in …5
×

Hacku yql durga

775 views

Published on

YQL ppt presented in IIT Kharagpur in Hack U 2012

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

  • Be the first to like this

No Downloads
Views
Total views
775
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

Hacku yql durga

  1. 1. + YQL Durga Sankari Yahoo! Labs
  2. 2. + Agenda   YQL Overview   Making Queries and the Console   Different ways of using YQL
  3. 3. + Data manipulation Hacks = + Data visualization
  4. 4. + Web has lots of Data around
  5. 5. + Yahoo! has also opened up its data.
  6. 6. + http://developer.yahoo.com/everything.html
  7. 7. + The trouble with data   You need to find data API   Get Access – Signup for key   Find data endpoint   Read docs to learn what parameters you have   Get data in obscure format   Use data after converting and filtering   More APIs you use, more is your annoyance
  8. 8. + To make data access easy on the web, Yahoo! created YQL
  9. 9. +   YQL turns webservices and data on the web into databases.   YQL lets you access almost all API s in a standardized manner.
  10. 10. + PI List on consoleA Yahoo! Developer Network
  11. 11. + select {what} from {where} where {conditions} Yahoo! Developer Network
  12. 12. + You can select, filter,sort and limit data and you can even insert,update and delete from it.
  13. 13. +http://developer.yahoo.com/yql/console
  14. 14. + Finding Videos about IIT-KGP SELECT * FROM youtube.search where query= IIT Kharagpur
  15. 15. +   SELECT * FROM twitter.search WHERE q=hacku   SELECT * FROM twitter.search WHERE q=hacku Limit 5   INSERT INTO social.contacts (owner_guid, givenName, familyName, email, nickname) VALUES (me, frnd_name, frnd_familyname, frnd_emailid , frnd_nickname )   SELECT * from social.contacts(500) WHERE guid=me and fields.value.givenName= frnd_name   select * from html where url="http://finance.yahoo.com/q? s=YHOO" and xpath=//*[@id="yfs_l84_yhoo"]
  16. 16. + Accessing Private Data   http://query.yahooapis.com/v1/yql   Uses OAuth 1.0 for authorization   OAuth is complicated – use one of our SDKs   https://github.com/yahoo
  17. 17. + YQL in HTML <html> <head> <title>YUI in YQL</title> <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script> <script type="text/javascript"> YUI().use(node, yql, function(Y) {       Y.YQL(SELECT * FROM upcoming.events WHERE location = "Bangalore", function(r) {         // process the result json object         console.log(r.query.results.event);     }); }); </script> </head> <body> </body> </html>
  18. 18. + USE YQL IN PHP <?php //Code to access YQL using PHP $yql_query = "SELECT * FROM upcoming.events WHERE location = %s"; //YQL query to retrieve search results $value = "bangalore"; var_dump(getResultFromYQL(sprintf($yql_query, $value))); /*** Function to get results from YQL * @param String $yql_query - The YQL Query * @param String $env - Environment in which the YQL Query should be executed. (Optional) * @return object response */ function getResultFromYQL($yql_query, $env = ) {     $yql_base_url = "http://query.yahooapis.com/v1/public/yql";     $yql_query_url = $yql_base_url . "?q=" . urlencode($yql_query);     $yql_query_url .= "&format=json";     if ($env != )         $yql_query_url .= &env= . urlencode($env);     $session = curl_init($yql_query_url);     curl_setopt($session, CURLOPT_RETURNTRANSFER, true);     //Uncomment if you are behind a proxy     //curl_setopt($session, CURLOPT_PROXY, Your proxy url);     //curl_setopt($session, CURLOPT_PROXYPORT, Your proxy port);     //curl_setopt($session, CURLOPT_PROXYUSERPWD, Your proxy password);     $json = curl_exec($session);     curl_close($session);     return json_decode($json); } ?>
  19. 19. + USE YQL IN JAVASCRIPT   YUI().use(node, gallery-yql, function(Y) { // Specify the YQL query var q2 = new Y.yql("select * from twitter.translate where search= hacku and language="hi" and amount=10"); var placemaker = new Y.yql ( SELECT * FROM geo.placemaker WHERE documentContent IN (select text from twitter.search where q="hacku") AND documentType="text/plain"); q2.on(query, function(response) {do some stuff here});
  20. 20. + THANK YOU

×