SlideShare a Scribd company logo
1 of 26
Yahoo Query Language: select * from internet Derek Gathright
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c YQL YQL stmt
Why YQL? Thousands of Web Services and sources that provide valuable data Require Developers to read documentation and form URLs/queries. Data is isolated Needs filtering, combining, tweaking, shaping even after it gets to the developer.
What is YQL? Cloud web service and SQL-Like Language  Familiar to developers Synonymous with Data access Expressive enough to get the right data. Self describing - show, desc table Allows you to query, filter, join and update data across any structured data on the web / web services And Yahoo’s sherpa cloud storage Real time engine
YQL Statement Basics show: lists the supported tables desc: describes the structure of a table select: fetches data insert/update/delete: modify data use: use an Open Data Table set: define key-values across Open Data Tables
Insert / Update / Delete With INSERT/ UPDATE/ DELETESQL verbs you can modify data on the internet or cloud create tweets, add blog entries, update DBs etc store tables or pieces of code in sherpa Some tables with I/U/D Twitter, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
Demo: developer.yahoo.com/yql/
Get any data: Open Data Tables
Open Data Tables ,[object Object]
datatables.orgmirrors the master and builds a single environment with all tables (faster serving)
Console with community tables
Brings the power of the table model to new APIs
Schema defines mapping between YQL and Endpoint
Keys can either be query, path or matrix parameters
Keys can be marked as required
YQL Compiler validates existence of required keys,[object Object]
Open Data Table example
Open Data Table example
ODT <execute> element Extends Open Data Tables with server-side code Javascript server-side scripting No DOM, events etc, pure JS scripting E4X support - XML literals, filtering ... YQL no longer performs a GET request to the table binding URL YQL provides additional useful global objects request, response, y.rest, y.include, y.query... Execute tag must return the data that will be the output of the YQL select Move business logic of your application to the cloud
What you can do with <execute> access APIs that require authentication Netflix OAuth, FlickrAuth, Google AuthSub join data across services grab New York Times article tags and generate find associated flickr photos combine multiple searches into a single result (twitter, web, news and images) augment data: city/state to APIs that just return zip code create APIs from web page celebrity birthdays scraped from imdb, caltrain data transformation convert the result from xml to Google's kml format
hello world <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta>     <sampleQuery>select * from {table} where a=’hello' and b=’world';</sampleQuery> </meta> <bindings> <select itemPath="" produces="XML"> <urls><url>http://fake.url/{a}</url></urls> <inputs> <key id='a' type='xs:string' paramType='path' required="true" /> <key id='b' type='xs:string' paramType='variable' required="true" /> </inputs> <execute><![CDATA[ // Your javascript goes here. We will run it on our servers response.object = <item> <url>{request.url}</url> <a>{a}</a>                    <b>{b}</b>                 </item>;       ]]></execute>    </select>   </bindings> </table>
Scraping a page <select produces="XML" itemPath="deals.deal">       <urls><url>http://deals.yahoo.com</url></urls>       <execute><![CDATA[ vardealhtml = y.query("select * from html where url='http://deals.yahoo.com' and xpath='//div[contains(@class, quot;product-displayquot;)]'").results; var deals = <deals/>; function compress(object) {     if (!object) return "";     return object.toString().replace(/+/, " ") } for each (var div in dealhtml.div) { var deal = <deal/>; deal.name += <name>{compress(div.h3.a.text())}</name>; deal.link += <link>{div.div[0].a.@href}</link>; … deal.description += <description>{compress(div.p[0].*)}</description>; deal.logo += <logo>{compress(div.div[1].*)}</logo>; deals.deal += deal; } response.object = deals;       ]]></execute>     </select>
Twitter Select select *from twitter.statuswhere id="2108869549"andusername="xxx"and password="yyy” <select itemPath="" produces="XML"> 	<urls><url>http://twitter.com/statuses/show/{id}.xml</url></urls> 	<inputs> 		<key id="username" type="xs:string" required="false" paramType="variable"/> 		<key id="password" type="xs:string" required="false" paramType="variable"/> 		<key id="id" type="xs:integer" required="true" paramType="path"/> 	</inputs> 	<execute><![CDATA[ varr = null;      	if (username && password) {          		y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); r = request.header("Authorization",authheader).get().response;       	} else { r = request.get().response;       	} response.object = r; 	]]></execute> </select>

More Related Content

Viewers also liked

Edisi 6 Des Nas
Edisi 6 Des NasEdisi 6 Des Nas
Edisi 6 Des Nasepaper
 
Edisi 6 Des 2009 Nas
Edisi 6 Des 2009 NasEdisi 6 Des 2009 Nas
Edisi 6 Des 2009 Nasepaper
 
TIGHITCO Presentation
TIGHITCO PresentationTIGHITCO Presentation
TIGHITCO Presentationpriley4rsa
 
Project UpCity - Local Phase Report
Project UpCity - Local Phase ReportProject UpCity - Local Phase Report
Project UpCity - Local Phase ReportAdi Buzgar
 
Vim Cards - Keynote Format
Vim Cards - Keynote FormatVim Cards - Keynote Format
Vim Cards - Keynote FormatAdam Lowe
 
Frdm
FrdmFrdm
FrdmFRDM
 
Empower, engage, enrich pcca 2016
Empower, engage, enrich   pcca 2016Empower, engage, enrich   pcca 2016
Empower, engage, enrich pcca 2016Tim Richardson
 
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Deepak Ravindran
 
Aiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAnastasiya Avdeyeva
 
Edisi16oktnasional
Edisi16oktnasionalEdisi16oktnasional
Edisi16oktnasionalepaper
 
Edisi4novnas
Edisi4novnasEdisi4novnas
Edisi4novnasepaper
 
6juni nas
6juni nas6juni nas
6juni nasepaper
 
The case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationThe case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationJavier Ruiz
 
Edisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruEdisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruepaper
 
Edisi 18 Nov Nas
Edisi 18 Nov NasEdisi 18 Nov Nas
Edisi 18 Nov Nasepaper
 
Почему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапПочему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапMax Ischenko
 
GXYSearch: job seeking advice
GXYSearch: job seeking adviceGXYSearch: job seeking advice
GXYSearch: job seeking adviceJoanne Spain
 

Viewers also liked (20)

TESTANDO
TESTANDOTESTANDO
TESTANDO
 
Kilifi Pictures
Kilifi  PicturesKilifi  Pictures
Kilifi Pictures
 
Edisi 6 Des Nas
Edisi 6 Des NasEdisi 6 Des Nas
Edisi 6 Des Nas
 
Edisi 6 Des 2009 Nas
Edisi 6 Des 2009 NasEdisi 6 Des 2009 Nas
Edisi 6 Des 2009 Nas
 
TIGHITCO Presentation
TIGHITCO PresentationTIGHITCO Presentation
TIGHITCO Presentation
 
Project UpCity - Local Phase Report
Project UpCity - Local Phase ReportProject UpCity - Local Phase Report
Project UpCity - Local Phase Report
 
Vim Cards - Keynote Format
Vim Cards - Keynote FormatVim Cards - Keynote Format
Vim Cards - Keynote Format
 
Frdm
FrdmFrdm
Frdm
 
Empower, engage, enrich pcca 2016
Empower, engage, enrich   pcca 2016Empower, engage, enrich   pcca 2016
Empower, engage, enrich pcca 2016
 
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
 
Aiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For Sandora
 
Edisi16oktnasional
Edisi16oktnasionalEdisi16oktnasional
Edisi16oktnasional
 
Ecommerce 2k9
Ecommerce 2k9Ecommerce 2k9
Ecommerce 2k9
 
Edisi4novnas
Edisi4novnasEdisi4novnas
Edisi4novnas
 
6juni nas
6juni nas6juni nas
6juni nas
 
The case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationThe case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organization
 
Edisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruEdisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baru
 
Edisi 18 Nov Nas
Edisi 18 Nov NasEdisi 18 Nov Nas
Edisi 18 Nov Nas
 
Почему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапПочему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартап
 
GXYSearch: job seeking advice
GXYSearch: job seeking adviceGXYSearch: job seeking advice
GXYSearch: job seeking advice
 

Similar to Yahoo Query Language: Select * from Internet

Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2tonvanbart
 
Dynamic Struts Forms
Dynamic Struts FormsDynamic Struts Forms
Dynamic Struts Formsscacharya
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWRSweNz FixEd
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiBalaji Narayanan
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rob
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.Nerd Tzanetopoulos
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and DashboardsAtlassian
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration{item:foo}
 

Similar to Yahoo Query Language: Select * from Internet (20)

Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
 
Dynamic Struts Forms
Dynamic Struts FormsDynamic Struts Forms
Dynamic Struts Forms
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWR
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT Chennai
 
GWT
GWTGWT
GWT
 
Gooogle Web Toolkit
Gooogle Web ToolkitGooogle Web Toolkit
Gooogle Web Toolkit
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
 
Hacking with YUI
Hacking with YUIHacking with YUI
Hacking with YUI
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Struts2
Struts2Struts2
Struts2
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
Opensocial Codelab
Opensocial CodelabOpensocial Codelab
Opensocial Codelab
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Yahoo Query Language: Select * from Internet

  • 1. Yahoo Query Language: select * from internet Derek Gathright
  • 2.
  • 3. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
  • 4. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
  • 5. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c YQL YQL stmt
  • 6. Why YQL? Thousands of Web Services and sources that provide valuable data Require Developers to read documentation and form URLs/queries. Data is isolated Needs filtering, combining, tweaking, shaping even after it gets to the developer.
  • 7. What is YQL? Cloud web service and SQL-Like Language Familiar to developers Synonymous with Data access Expressive enough to get the right data. Self describing - show, desc table Allows you to query, filter, join and update data across any structured data on the web / web services And Yahoo’s sherpa cloud storage Real time engine
  • 8. YQL Statement Basics show: lists the supported tables desc: describes the structure of a table select: fetches data insert/update/delete: modify data use: use an Open Data Table set: define key-values across Open Data Tables
  • 9. Insert / Update / Delete With INSERT/ UPDATE/ DELETESQL verbs you can modify data on the internet or cloud create tweets, add blog entries, update DBs etc store tables or pieces of code in sherpa Some tables with I/U/D Twitter, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
  • 11. Get any data: Open Data Tables
  • 12.
  • 13. datatables.orgmirrors the master and builds a single environment with all tables (faster serving)
  • 15. Brings the power of the table model to new APIs
  • 16. Schema defines mapping between YQL and Endpoint
  • 17. Keys can either be query, path or matrix parameters
  • 18. Keys can be marked as required
  • 19.
  • 20. Open Data Table example
  • 21. Open Data Table example
  • 22. ODT <execute> element Extends Open Data Tables with server-side code Javascript server-side scripting No DOM, events etc, pure JS scripting E4X support - XML literals, filtering ... YQL no longer performs a GET request to the table binding URL YQL provides additional useful global objects request, response, y.rest, y.include, y.query... Execute tag must return the data that will be the output of the YQL select Move business logic of your application to the cloud
  • 23. What you can do with <execute> access APIs that require authentication Netflix OAuth, FlickrAuth, Google AuthSub join data across services grab New York Times article tags and generate find associated flickr photos combine multiple searches into a single result (twitter, web, news and images) augment data: city/state to APIs that just return zip code create APIs from web page celebrity birthdays scraped from imdb, caltrain data transformation convert the result from xml to Google's kml format
  • 24. hello world <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <sampleQuery>select * from {table} where a=’hello' and b=’world';</sampleQuery> </meta> <bindings> <select itemPath="" produces="XML"> <urls><url>http://fake.url/{a}</url></urls> <inputs> <key id='a' type='xs:string' paramType='path' required="true" /> <key id='b' type='xs:string' paramType='variable' required="true" /> </inputs> <execute><![CDATA[ // Your javascript goes here. We will run it on our servers response.object = <item> <url>{request.url}</url> <a>{a}</a> <b>{b}</b> </item>; ]]></execute> </select> </bindings> </table>
  • 25. Scraping a page <select produces="XML" itemPath="deals.deal"> <urls><url>http://deals.yahoo.com</url></urls> <execute><![CDATA[ vardealhtml = y.query("select * from html where url='http://deals.yahoo.com' and xpath='//div[contains(@class, quot;product-displayquot;)]'").results; var deals = <deals/>; function compress(object) { if (!object) return ""; return object.toString().replace(/+/, " ") } for each (var div in dealhtml.div) { var deal = <deal/>; deal.name += <name>{compress(div.h3.a.text())}</name>; deal.link += <link>{div.div[0].a.@href}</link>; … deal.description += <description>{compress(div.p[0].*)}</description>; deal.logo += <logo>{compress(div.div[1].*)}</logo>; deals.deal += deal; } response.object = deals; ]]></execute> </select>
  • 26. Twitter Select select *from twitter.statuswhere id="2108869549"andusername="xxx"and password="yyy” <select itemPath="" produces="XML"> <urls><url>http://twitter.com/statuses/show/{id}.xml</url></urls> <inputs> <key id="username" type="xs:string" required="false" paramType="variable"/> <key id="password" type="xs:string" required="false" paramType="variable"/> <key id="id" type="xs:integer" required="true" paramType="path"/> </inputs> <execute><![CDATA[ varr = null; if (username && password) { y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); r = request.header("Authorization",authheader).get().response; } else { r = request.get().response; } response.object = r; ]]></execute> </select>
  • 27. Twitter Update insert into twitter.status(status,username,password)values ("new tweet from YQL",”xxx”,”yyy”); <insert itemPath="" produces="XML"> <urls> <url>http://twitter.com/statuses/update.xml</url> </urls> <inputs> <value id="username" type="xs:string" required="true" paramType="variable"/> <value id="password" type="xs:string" required="true" paramType="variable"/> <value id="status" type="xs:string" required="true" paramType="variable"/> </inputs> <execute><![CDATA[ y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); var content = "status="+status; response.object = request.header("Authorization",authheader).post(content).response; ]]></execute> </insert>
  • 28. Twitter Delete delete from twitter.statuswhere id="2108869549"and username="xxx"and password="yyy” <delete itemPath="" produces="XML"> <urls> <url>http://twitter.com/statuses/destroy/{id}.xml</url> </urls> <inputs> <key id="username" type="xs:string" required="true" paramType="variable"/> <key id="password" type="xs:string" required="true" paramType="variable"/> <key id="id" type="xs:string" required="true" paramType="path"/> </inputs> <execute><![CDATA[ y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); response.object = request.header("Authorization",authheader).del().response; ]]></execute> </delete>
  • 29. Conclusion More easily build applications fewer lines of code data processing done away from app consistent and familiar syntax for all data access
  • 30.
  • 31. store tables, environments, js, text files…
  • 32. conversion, filtering, parallel requests...With smaller network footprint fewer (client) calls smaller data amounts closer to the data, fatter pipes
  • 33.
  • 35.