SlideShare uma empresa Scribd logo
1 de 73
Remixing web data for your hacks the easy way YQL – the can opener of the web
Hacking together systems in 24 hours is a lot of fun.
But you want to spend that time thinking about the interface.
And not how you get to the right data in the right format.
The web is full of juicy and long lasting data. http://www.flickr.com/photos/clspeace/162336973/
And there is a lot of it around. http://www.flickr.com/photos/tudor/2981410947/
However, our attempts to get to it can be clumsy. http://www.flickr.com/photos/lumachrome/2140368742/
What we need is an easy way to get to that data. http://www.flickr.com/photos/careytilden/115435226/
We had a way to do that for quite a while now.
http://pipes.yahoo.com/
Pipes, however is high end technology… http://www.flickr.com/photos/axio/2346342672/
We’re developers, not interface users. http://www.flickr.com/photos/codepo8/2278641937/
So for a long time people asked Yahoo for a command line version of pipes. Can we have one?
Yes, we can!
The Yahoo Query Language, or short YQL is a unified interface language to the web. http://developer.yahoo.com/yql/
Using YQL, accessing the web and its services becomes as easy as SQL: select {what} from {service} where {condition}
Say you want kittens in your hack (who doesn’t?) select * from flickr.photos.search where text="kitten"
Say you want kittens in your hack (who doesn’t?)
Say you only want 5 kittens select * from flickr.photos.search where text="kitten" limit 5
Say you only want 5 kittens
Nice, but where can you get this?
YQL is a REST API in itself, and it has two endpoints.
The public endpoint does not need any authentication. http://query.yahooapis.com/v1/public/yql?q={query} &format={format}
The private endpoint needs oauth authentication. http://query.yahooapis.com/v1/yql?q={query} &format={format} http://developer.yahoo.com/yql/guide/authorization-access.html
Output formats are XML or JSON.  JSON also allows for a callback parameter to use the output directly as JSON-P.
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from flickr.photos.search%20where%20text=%22kitten%22limit%205&format=json&callback=meow
 
You can mix and match several web services using the in() command.
Guess what this does: select * from flickr.photos.info where photo_id in (select id from flickr.photos.search where woe_id in (select woeid from geo.places where text='london,uk') and license=4)
Find photos in London, UK with a Creative Commons “By” license and give me all the information you have about them.
select * from flickr.photos.info where photo_id in (select id from flickr.photos.search where woe_id in (select woeid from geo.places where text='london,uk') and license=4)
Using a command like this and some out-of-the-box UI elements like Yahoo Maps and the YUI carousel, you can build something *very* quickly.
http://isithackday.com/hacks/cantine/index.php?loc=covent+garden
Instead of selecting all the information you can also limit the results: select name,url from upcoming.venue where metro_id in (select id from upcoming.metro where search_text="stokey")
select name,url from upcoming.venue where metro_id in (select id from upcoming.metro where search_text="stokey")
The diagnostics part of the returned data shows you what happened and how long it took
Here’s what Yahoo offers you in this format: flickr.photos.exif flickr.photos.info flickr.photos.interestingness flickr.photos.recent flickr.photos.search flickr.photos.sizes flickr.places flickr.places.info geo.places geo.places.ancestors geo.places.belongtos geo.places.children geo.places.neighbors geo.places.parent geo.places.siblings geo.placetypes gnip.activity local.search music.artist.id music.artist.popular music.artist.search music.artist.similar music.release.artist music.release.id music.release.popular music.release.search music.track.id music.track.popular music.track.search music.video.category music.video.id music.video.popular music.video.search music.video.similar mybloglog.community.find mybloglog.member mybloglog.member.contacts mybloglog.member.newwithcontacts mybloglog.member.newwithme mybloglog.members.find mybloglog.stats.find upcoming.category upcoming.country upcoming.events upcoming.events.bestinplace upcoming.groups upcoming.metro upcoming.state upcoming.user upcoming.venue
Here’s what Yahoo offers you in this format: search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview
You want even more? http://www.flickr.com/photos/verylastexcitingmoment/3123597774/
Alright, how about this? atom csv feed html json microformats rss xml
Telegraph’s headlines anyone? select * from html where url='http://www.telegraph.co.uk/' and xpath='//h3/a'
Telegraph’s headlines anyone?
You can dynamically create YQL queries to collate several sources…
Then use cURL to pull them off the web with one single http request!
YQL caches and compresses the results for you. Pretty easy, isn’t it?
Here’s another fun part: Anyone can be part of the YQL interface.
All we need the data provider to do is to create a schema that explains their data structure. http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html
And people do… http://github.com/spullara/yql-tables/tree/master amazon bitly delicious dopplr etsy friendfeed github Greader guardian imdb iplocation lastfm nestoria netflix nmm nyt opensocial search shopping social twitter update.groovy weather wesabe whitepages yahoo yelp zillow
For example the national maritime museum: select * from nmm.archive.search where searchterm=‘horatio nelson'
select * from nmm.archive.search where searchterm=‘horatio nelson'
That’s pretty cool – allowing anyone to be part of this interface.
The only shame is that you can’t do all the things in YQL that you can do in Pipes – for example string manipulation.
We wondered how to make this possible. One thing we didn’t want to sacrifice is the simplicity of the language itself.
So instead of inventing an own language, we decided to piggy-back on one you already know.
YQL execute allows you to embed JavaScript in the open table schema that runs on the YQL server and converts the data for you. http://developer.yahoo.com/yql/guide/yql-execute-chapter.html
For example you can augment an existing service to do something different. The following example adds a rank to search results. http://www.yqlblog.net/samples/searchrank.xml
 
 
Stored as XML this can be used in a YQL query: use 'http://yqlblog.net/samples/searchrank.xml' as searchrank;  select * from searchrank where query='pizza' and dispurl like '%pizzahut% '
 
Anyways, the *easiest* way to start with YQL is to use the console. http://developer.yahoo.com/yql/console/
 
 
 
 
 
 
 
 
 
Of course, you can also spend half the hack day reading API docs  
Check out some code examples on. http://isithackday.com/hacks/ohd-london
THANKS! Chris Heilmann http://twitter.com/codepo8

Mais conteúdo relacionado

Mais procurados

Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016Colin O'Dell
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Colin O'Dell
 
Ppt copyright by Kay Cantwell
Ppt copyright by Kay CantwellPpt copyright by Kay Cantwell
Ppt copyright by Kay CantwellVu Phu
 
How The Open Data Community Died - A Warning From The Future
How The Open Data Community Died - A Warning From The FutureHow The Open Data Community Died - A Warning From The Future
How The Open Data Community Died - A Warning From The FutureChris Taggart
 
Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Paul Seiffert
 
Our students won_t_research_the_way_we_did
Our students won_t_research_the_way_we_didOur students won_t_research_the_way_we_did
Our students won_t_research_the_way_we_didNate Kogan
 
Social trends
Social trendsSocial trends
Social trendsdtexter
 
Professional Persona Project
Professional Persona ProjectProfessional Persona Project
Professional Persona ProjectNtricateDesigns
 

Mais procurados (12)

Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016Debugging Effectively - DrupalCon Europe 2016
Debugging Effectively - DrupalCon Europe 2016
 
NBR DEVELOPERS
NBR DEVELOPERSNBR DEVELOPERS
NBR DEVELOPERS
 
Thru The Lens
Thru The LensThru The Lens
Thru The Lens
 
redhat_intern
redhat_internredhat_intern
redhat_intern
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
 
Ppt copyright by Kay Cantwell
Ppt copyright by Kay CantwellPpt copyright by Kay Cantwell
Ppt copyright by Kay Cantwell
 
How The Open Data Community Died - A Warning From The Future
How The Open Data Community Died - A Warning From The FutureHow The Open Data Community Died - A Warning From The Future
How The Open Data Community Died - A Warning From The Future
 
Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14
 
Our students won_t_research_the_way_we_did
Our students won_t_research_the_way_we_didOur students won_t_research_the_way_we_did
Our students won_t_research_the_way_we_did
 
Social trends
Social trendsSocial trends
Social trends
 
Professional Persona Project
Professional Persona ProjectProfessional Persona Project
Professional Persona Project
 
Research 2 0
Research 2 0Research 2 0
Research 2 0
 

Destaque

Yahoo BOSS Presentation London Open Hack Day Talk Boss
Yahoo BOSS Presentation London Open Hack Day Talk   BossYahoo BOSS Presentation London Open Hack Day Talk   Boss
Yahoo BOSS Presentation London Open Hack Day Talk BossKorben00
 
Conférence Net Neutrality
Conférence Net NeutralityConférence Net Neutrality
Conférence Net NeutralityKorben00
 
Sebastian Porst - Reverse-Engineering Flash Files with SWFRETools
Sebastian Porst - Reverse-Engineering Flash Files with SWFREToolsSebastian Porst - Reverse-Engineering Flash Files with SWFRETools
Sebastian Porst - Reverse-Engineering Flash Files with SWFREToolsSource Conference
 
Double Dog Dare
Double Dog Dare Double Dog Dare
Double Dog Dare halffast
 

Destaque (6)

Yahoo BOSS Presentation London Open Hack Day Talk Boss
Yahoo BOSS Presentation London Open Hack Day Talk   BossYahoo BOSS Presentation London Open Hack Day Talk   Boss
Yahoo BOSS Presentation London Open Hack Day Talk Boss
 
Conférence Net Neutrality
Conférence Net NeutralityConférence Net Neutrality
Conférence Net Neutrality
 
Hack Day EU 2011 YQL
Hack Day EU 2011 YQLHack Day EU 2011 YQL
Hack Day EU 2011 YQL
 
Hack with YUI
Hack with YUIHack with YUI
Hack with YUI
 
Sebastian Porst - Reverse-Engineering Flash Files with SWFRETools
Sebastian Porst - Reverse-Engineering Flash Files with SWFREToolsSebastian Porst - Reverse-Engineering Flash Files with SWFRETools
Sebastian Porst - Reverse-Engineering Flash Files with SWFRETools
 
Double Dog Dare
Double Dog Dare Double Dog Dare
Double Dog Dare
 

Semelhante a YQL - Christian Heilmann Open Hack London presentation

Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQLChristian Heilmann
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internetdrgath
 
YQL: Select * from Internet
YQL: Select * from InternetYQL: Select * from Internet
YQL: Select * from Internetdrgath
 
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012Saurabh Sahni
 
Mashups & Data Visualizations: The New Breed of Web Applications
Mashups & Data Visualizations: The New Breed of Web ApplicationsMashups & Data Visualizations: The New Breed of Web Applications
Mashups & Data Visualizations: The New Breed of Web ApplicationsDarlene Fichter
 
Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Christian Heilmann
 
Using Web Services with JavaScript - Fronttrends 2010
Using Web Services with JavaScript - Fronttrends 2010Using Web Services with JavaScript - Fronttrends 2010
Using Web Services with JavaScript - Fronttrends 2010Christian Heilmann
 
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on RailsUsing ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on RailsDave Bouwman
 
Avoiding API Library Antipatterns
Avoiding API Library AntipatternsAvoiding API Library Antipatterns
Avoiding API Library AntipatternsPaul Mison
 
Georgia Tech hacking Accessibility
Georgia Tech hacking AccessibilityGeorgia Tech hacking Accessibility
Georgia Tech hacking AccessibilityChristian Heilmann
 
EdTechJoker Spring 2020 - Lecture 8 Drupal again
EdTechJoker Spring 2020 - Lecture 8 Drupal againEdTechJoker Spring 2020 - Lecture 8 Drupal again
EdTechJoker Spring 2020 - Lecture 8 Drupal againBryan Ollendyke
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approvalSimon Willison
 

Semelhante a YQL - Christian Heilmann Open Hack London presentation (20)

Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQL
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
Hacking For Innovation
Hacking For InnovationHacking For Innovation
Hacking For Innovation
 
Yahoo is open to developers
Yahoo is open to developersYahoo is open to developers
Yahoo is open to developers
 
Technical Introduction to YDN
Technical Introduction to YDNTechnical Introduction to YDN
Technical Introduction to YDN
 
Yahoo for the Masses
Yahoo for the MassesYahoo for the Masses
Yahoo for the Masses
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internet
 
YQL: Select * from Internet
YQL: Select * from InternetYQL: Select * from Internet
YQL: Select * from Internet
 
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
 
Mashups & Data Visualizations: The New Breed of Web Applications
Mashups & Data Visualizations: The New Breed of Web ApplicationsMashups & Data Visualizations: The New Breed of Web Applications
Mashups & Data Visualizations: The New Breed of Web Applications
 
Things to use, find and share
Things to use, find and shareThings to use, find and share
Things to use, find and share
 
Georgia Tech Hack Day
Georgia Tech Hack DayGeorgia Tech Hack Day
Georgia Tech Hack Day
 
Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)Things you can use (by the Yahoo Developer Network and friends)
Things you can use (by the Yahoo Developer Network and friends)
 
Yahoo xtra Open Technolgies
Yahoo xtra Open TechnolgiesYahoo xtra Open Technolgies
Yahoo xtra Open Technolgies
 
Using Web Services with JavaScript - Fronttrends 2010
Using Web Services with JavaScript - Fronttrends 2010Using Web Services with JavaScript - Fronttrends 2010
Using Web Services with JavaScript - Fronttrends 2010
 
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on RailsUsing ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
 
Avoiding API Library Antipatterns
Avoiding API Library AntipatternsAvoiding API Library Antipatterns
Avoiding API Library Antipatterns
 
Georgia Tech hacking Accessibility
Georgia Tech hacking AccessibilityGeorgia Tech hacking Accessibility
Georgia Tech hacking Accessibility
 
EdTechJoker Spring 2020 - Lecture 8 Drupal again
EdTechJoker Spring 2020 - Lecture 8 Drupal againEdTechJoker Spring 2020 - Lecture 8 Drupal again
EdTechJoker Spring 2020 - Lecture 8 Drupal again
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approval
 

Último

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Último (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

YQL - Christian Heilmann Open Hack London presentation

  • 1. Remixing web data for your hacks the easy way YQL – the can opener of the web
  • 2. Hacking together systems in 24 hours is a lot of fun.
  • 3. But you want to spend that time thinking about the interface.
  • 4. And not how you get to the right data in the right format.
  • 5. The web is full of juicy and long lasting data. http://www.flickr.com/photos/clspeace/162336973/
  • 6. And there is a lot of it around. http://www.flickr.com/photos/tudor/2981410947/
  • 7. However, our attempts to get to it can be clumsy. http://www.flickr.com/photos/lumachrome/2140368742/
  • 8. What we need is an easy way to get to that data. http://www.flickr.com/photos/careytilden/115435226/
  • 9. We had a way to do that for quite a while now.
  • 11. Pipes, however is high end technology… http://www.flickr.com/photos/axio/2346342672/
  • 12. We’re developers, not interface users. http://www.flickr.com/photos/codepo8/2278641937/
  • 13. So for a long time people asked Yahoo for a command line version of pipes. Can we have one?
  • 15. The Yahoo Query Language, or short YQL is a unified interface language to the web. http://developer.yahoo.com/yql/
  • 16. Using YQL, accessing the web and its services becomes as easy as SQL: select {what} from {service} where {condition}
  • 17. Say you want kittens in your hack (who doesn’t?) select * from flickr.photos.search where text="kitten"
  • 18. Say you want kittens in your hack (who doesn’t?)
  • 19. Say you only want 5 kittens select * from flickr.photos.search where text="kitten" limit 5
  • 20. Say you only want 5 kittens
  • 21. Nice, but where can you get this?
  • 22. YQL is a REST API in itself, and it has two endpoints.
  • 23. The public endpoint does not need any authentication. http://query.yahooapis.com/v1/public/yql?q={query} &format={format}
  • 24. The private endpoint needs oauth authentication. http://query.yahooapis.com/v1/yql?q={query} &format={format} http://developer.yahoo.com/yql/guide/authorization-access.html
  • 25. Output formats are XML or JSON. JSON also allows for a callback parameter to use the output directly as JSON-P.
  • 27.  
  • 28. You can mix and match several web services using the in() command.
  • 29. Guess what this does: select * from flickr.photos.info where photo_id in (select id from flickr.photos.search where woe_id in (select woeid from geo.places where text='london,uk') and license=4)
  • 30. Find photos in London, UK with a Creative Commons “By” license and give me all the information you have about them.
  • 31. select * from flickr.photos.info where photo_id in (select id from flickr.photos.search where woe_id in (select woeid from geo.places where text='london,uk') and license=4)
  • 32. Using a command like this and some out-of-the-box UI elements like Yahoo Maps and the YUI carousel, you can build something *very* quickly.
  • 34. Instead of selecting all the information you can also limit the results: select name,url from upcoming.venue where metro_id in (select id from upcoming.metro where search_text="stokey")
  • 35. select name,url from upcoming.venue where metro_id in (select id from upcoming.metro where search_text="stokey")
  • 36. The diagnostics part of the returned data shows you what happened and how long it took
  • 37. Here’s what Yahoo offers you in this format: flickr.photos.exif flickr.photos.info flickr.photos.interestingness flickr.photos.recent flickr.photos.search flickr.photos.sizes flickr.places flickr.places.info geo.places geo.places.ancestors geo.places.belongtos geo.places.children geo.places.neighbors geo.places.parent geo.places.siblings geo.placetypes gnip.activity local.search music.artist.id music.artist.popular music.artist.search music.artist.similar music.release.artist music.release.id music.release.popular music.release.search music.track.id music.track.popular music.track.search music.video.category music.video.id music.video.popular music.video.search music.video.similar mybloglog.community.find mybloglog.member mybloglog.member.contacts mybloglog.member.newwithcontacts mybloglog.member.newwithme mybloglog.members.find mybloglog.stats.find upcoming.category upcoming.country upcoming.events upcoming.events.bestinplace upcoming.groups upcoming.metro upcoming.state upcoming.user upcoming.venue
  • 38. Here’s what Yahoo offers you in this format: search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview search.images search.news search.siteexplorer.inlinks search.siteexplorer.pages search.spelling search.suggest search.termextract search.web social.connections social.contacts social.presence social.profile social.updates weather.forecast yahoo.identity yap.setsmallview
  • 39. You want even more? http://www.flickr.com/photos/verylastexcitingmoment/3123597774/
  • 40. Alright, how about this? atom csv feed html json microformats rss xml
  • 41. Telegraph’s headlines anyone? select * from html where url='http://www.telegraph.co.uk/' and xpath='//h3/a'
  • 43. You can dynamically create YQL queries to collate several sources…
  • 44. Then use cURL to pull them off the web with one single http request!
  • 45. YQL caches and compresses the results for you. Pretty easy, isn’t it?
  • 46. Here’s another fun part: Anyone can be part of the YQL interface.
  • 47. All we need the data provider to do is to create a schema that explains their data structure. http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html
  • 48. And people do… http://github.com/spullara/yql-tables/tree/master amazon bitly delicious dopplr etsy friendfeed github Greader guardian imdb iplocation lastfm nestoria netflix nmm nyt opensocial search shopping social twitter update.groovy weather wesabe whitepages yahoo yelp zillow
  • 49. For example the national maritime museum: select * from nmm.archive.search where searchterm=‘horatio nelson'
  • 50. select * from nmm.archive.search where searchterm=‘horatio nelson'
  • 51. That’s pretty cool – allowing anyone to be part of this interface.
  • 52. The only shame is that you can’t do all the things in YQL that you can do in Pipes – for example string manipulation.
  • 53. We wondered how to make this possible. One thing we didn’t want to sacrifice is the simplicity of the language itself.
  • 54. So instead of inventing an own language, we decided to piggy-back on one you already know.
  • 55. YQL execute allows you to embed JavaScript in the open table schema that runs on the YQL server and converts the data for you. http://developer.yahoo.com/yql/guide/yql-execute-chapter.html
  • 56. For example you can augment an existing service to do something different. The following example adds a rank to search results. http://www.yqlblog.net/samples/searchrank.xml
  • 57.  
  • 58.  
  • 59. Stored as XML this can be used in a YQL query: use 'http://yqlblog.net/samples/searchrank.xml' as searchrank; select * from searchrank where query='pizza' and dispurl like '%pizzahut% '
  • 60.  
  • 61. Anyways, the *easiest* way to start with YQL is to use the console. http://developer.yahoo.com/yql/console/
  • 62.  
  • 63.  
  • 64.  
  • 65.  
  • 66.  
  • 67.  
  • 68.  
  • 69.  
  • 70.  
  • 71. Of course, you can also spend half the hack day reading API docs 
  • 72. Check out some code examples on. http://isithackday.com/hacks/ohd-london
  • 73. THANKS! Chris Heilmann http://twitter.com/codepo8