SlideShare a Scribd company logo
1 of 76
Download to read offline
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.




                     hquot;p://www.flickr.com/photos/clspeace/162336973/
And there is a lot of it
around.




                      hquot;p://www.flickr.com/photos/tudor/2981410947/
However, our attempts to
get to it can be clumsy.




                  hquot;p://www.flickr.com/photos/lumachrome/2140368742/
What we need is an easy
way to get to that data.




                   hquot;p://www.flickr.com/photos/carey@lden/115435226/
We had a way to do that
for quite a while now.
http://pipes.yahoo.com/
Pipes, however is high end
technology…




                    hquot;p://www.flickr.com/photos/axio/2346342672/
We’re developers, not
interface users.




                   hquot;p://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=quot;kittenquot;
Say you want kittens in
your hack (who doesn’t?)
Say you only want 5 kittens

select * from
flickr.photos.search
where text=quot;kittenquot;
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}
hquot;p://developer.yahoo.com/yql/guide/
authoriza@on‐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 London, UK, without a
doubt.
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 of London, UK

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 of London, UK
with a “By” CC license
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)
Give me everything you
know about these photos.
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=quot;stokeyquot;)
select name,url from
upcoming.venue where metro_id in
(select id from upcoming.metro
where search_text=quot;stokeyquot;)
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             local.search            mybloglog.community.find
flickr.photos.info             music.ar0st.id          mybloglog.member
flickr.photos.interes0ngness   music.ar0st.popular     mybloglog.member.contacts
flickr.photos.recent           music.ar0st.search      mybloglog.member.newwithcontacts
flickr.photos.search           music.ar0st.similar     mybloglog.member.newwithme
flickr.photos.sizes            music.release.ar0st     mybloglog.members.find
flickr.places                  music.release.id        mybloglog.stats.find
flickr.places.info             music.release.popular   upcoming.category
geo.places                    music.release.search    upcoming.country
geo.places.ancestors          music.track.id          upcoming.events
geo.places.belongtos          music.track.popular     upcoming.events.bes0nplace
geo.places.children           music.track.search      upcoming.groups
geo.places.neighbors          music.video.category    upcoming.metro
geo.places.parent             music.video.id          upcoming.state
geo.places.siblings           music.video.popular     upcoming.user
geo.placetypes                music.video.search      upcoming.venue
gnip.ac0vity                  music.video.similar
Here’s what Yahoo offers you in this
  format:
search.images                 search.images                 search.images
search.news                   search.news                   search.news
search.siteexplorer.inlinks   search.siteexplorer.inlinks   search.siteexplorer.inlinks
search.siteexplorer.pages     search.siteexplorer.pages     search.siteexplorer.pages
search.spelling               search.spelling               search.spelling
search.suggest                search.suggest                search.suggest
search.termextract            search.termextract            search.termextract
search.web                    search.web                    search.web
social.connec0ons             social.connec0ons             social.connec0ons
social.contacts               social.contacts               social.contacts
social.presence               social.presence               social.presence
social.profile                 social.profile                 social.profile
social.updates                social.updates                social.updates
weather.forecast              weather.forecast              weather.forecast
yahoo.iden0ty                 yahoo.iden0ty                 yahoo.iden0ty
yap.setsmallview              yap.setsmallview              yap.setsmallview
You want even more?




             http://www.flickr.com/photos/verylastexcitingmoment/3123597774/
Alright, how about this?


              json
atom
              microformats
csv
              rss
feed
              xml
html
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…
amazon              nmm
bitly               nyt
delicious           opensocial
dopplr              search
etsy                shopping
friendfeed          social
github              twi?er
Greader             update.groovy
guardian            weather
imdb                wesabe
iploca0on           whitepages
las>m               yahoo
nestoria            yelp
ne>lix              zillow

http://github.com/spullara/yql-tables/tree/master
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

More Related Content

What's hot

Assumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfAssumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfErin Shellman
 
Workers of the web - BrazilJS 2013
Workers of the web - BrazilJS 2013Workers of the web - BrazilJS 2013
Workers of the web - BrazilJS 2013Thibault Imbert
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)Nicholas Zakas
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowRobert Nyman
 
WAPWG Clark defining capturing_web-based_if
WAPWG Clark defining capturing_web-based_ifWAPWG Clark defining capturing_web-based_if
WAPWG Clark defining capturing_web-based_ifSara Day Thomson
 
Extending spring
Extending springExtending spring
Extending springJoshua Long
 
University of arizona mobile matters - technology, a means to an end
University of arizona   mobile matters - technology, a means to an endUniversity of arizona   mobile matters - technology, a means to an end
University of arizona mobile matters - technology, a means to an endThibault Imbert
 
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSHTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSRobert Nyman
 
Scraping with Python for Fun and Profit - PyCon India 2010
Scraping with Python for Fun and Profit - PyCon India 2010Scraping with Python for Fun and Profit - PyCon India 2010
Scraping with Python for Fun and Profit - PyCon India 2010Abhishek Mishra
 
Working with LifeDesks
Working with LifeDesksWorking with LifeDesks
Working with LifeDesksKatja Schulz
 
Visdjango presentation django_boston_oct_2014
Visdjango presentation django_boston_oct_2014Visdjango presentation django_boston_oct_2014
Visdjango presentation django_boston_oct_2014jlbaldwin
 
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Sammy Fung
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)Robert Nyman
 
The Web Becomes Graceful
The Web Becomes GracefulThe Web Becomes Graceful
The Web Becomes Gracefulcolorhook
 
Stop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyStop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyAll Things Open
 

What's hot (20)

Assumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfAssumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourself
 
Workers of the web - BrazilJS 2013
Workers of the web - BrazilJS 2013Workers of the web - BrazilJS 2013
Workers of the web - BrazilJS 2013
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
 
Find,Mix And Show
Find,Mix And ShowFind,Mix And Show
Find,Mix And Show
 
WAPWG Clark defining capturing_web-based_if
WAPWG Clark defining capturing_web-based_ifWAPWG Clark defining capturing_web-based_if
WAPWG Clark defining capturing_web-based_if
 
CouchDB Day NYC 2017: Mango
CouchDB Day NYC 2017: MangoCouchDB Day NYC 2017: Mango
CouchDB Day NYC 2017: Mango
 
Extending spring
Extending springExtending spring
Extending spring
 
University of arizona mobile matters - technology, a means to an end
University of arizona   mobile matters - technology, a means to an endUniversity of arizona   mobile matters - technology, a means to an end
University of arizona mobile matters - technology, a means to an end
 
Web Scrapping with Python
Web Scrapping with PythonWeb Scrapping with Python
Web Scrapping with Python
 
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSHTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
 
Scraping with Python for Fun and Profit - PyCon India 2010
Scraping with Python for Fun and Profit - PyCon India 2010Scraping with Python for Fun and Profit - PyCon India 2010
Scraping with Python for Fun and Profit - PyCon India 2010
 
Working with LifeDesks
Working with LifeDesksWorking with LifeDesks
Working with LifeDesks
 
Visdjango presentation django_boston_oct_2014
Visdjango presentation django_boston_oct_2014Visdjango presentation django_boston_oct_2014
Visdjango presentation django_boston_oct_2014
 
Nodejs meetup-12-2-2015
Nodejs meetup-12-2-2015Nodejs meetup-12-2-2015
Nodejs meetup-12-2-2015
 
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)JavaScript and HTML5 - Brave New World (revised)
JavaScript and HTML5 - Brave New World (revised)
 
The Web Becomes Graceful
The Web Becomes GracefulThe Web Becomes Graceful
The Web Becomes Graceful
 
Stop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyStop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case Study
 

Similar to Open Hack London - Introduction to YQL

YQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationYQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationKorben00
 
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
 
Dundee University HackU 2013 - YQL
Dundee University HackU 2013 - YQLDundee University HackU 2013 - YQL
Dundee University HackU 2013 - YQLsmartads
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approvalSimon Willison
 
Semantic Web For Distributed Social Networks
Semantic Web For Distributed Social NetworksSemantic Web For Distributed Social Networks
Semantic Web For Distributed Social NetworksDavid Peterson
 
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
 
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
 
With Great Nerdery Comes Great Responsibility
With Great Nerdery Comes Great Responsibility With Great Nerdery Comes Great Responsibility
With Great Nerdery Comes Great Responsibility John Anderson
 

Similar to Open Hack London - Introduction to YQL (20)

YQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationYQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentation
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internet
 
Things to use, find and share
Things to use, find and shareThings to use, find and share
Things to use, find and share
 
YQL: Select * from Internet
YQL: Select * from InternetYQL: Select * from Internet
YQL: Select * from Internet
 
Yql with geo
Yql with geoYql with geo
Yql with geo
 
Yahoo for the Masses
Yahoo for the MassesYahoo for the Masses
Yahoo for the Masses
 
Dundee University HackU 2013 - YQL
Dundee University HackU 2013 - YQLDundee University HackU 2013 - YQL
Dundee University HackU 2013 - YQL
 
Georgia Tech Hack Day
Georgia Tech Hack DayGeorgia Tech Hack Day
Georgia Tech Hack Day
 
Making sense out of things on the web
Making sense out of things on the webMaking sense out of things on the web
Making sense out of things on the web
 
Technical Introduction to YDN
Technical Introduction to YDNTechnical Introduction to YDN
Technical Introduction to YDN
 
Hacking For Innovation
Hacking For InnovationHacking For Innovation
Hacking For Innovation
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approval
 
Semantic Web For Distributed Social Networks
Semantic Web For Distributed Social NetworksSemantic Web For Distributed Social Networks
Semantic Web For Distributed Social Networks
 
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
 
Hacking For Innovation Delhi
Hacking For Innovation DelhiHacking For Innovation Delhi
Hacking For Innovation Delhi
 
Yahoo is open to developers
Yahoo is open to developersYahoo is open to developers
Yahoo is open to developers
 
Yql hacku iitd_2012
Yql hacku iitd_2012Yql hacku iitd_2012
Yql hacku iitd_2012
 
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
 
With Great Nerdery Comes Great Responsibility
With Great Nerdery Comes Great Responsibility With Great Nerdery Comes Great Responsibility
With Great Nerdery Comes Great Responsibility
 

More from Christian Heilmann

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Christian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloChristian Heilmann
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteChristian Heilmann
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteChristian Heilmann
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandChristian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerChristian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?Christian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachChristian Heilmann
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsChristian Heilmann
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansChristian Heilmann
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Christian Heilmann
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlChristian Heilmann
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Christian Heilmann
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)Christian Heilmann
 

More from Christian Heilmann (20)

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019
 
Hinting at a better web
Hinting at a better webHinting at a better web
Hinting at a better web
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC Oslo
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynote
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynote
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays Finland
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developer
 
Taking the P out of PWA
Taking the P out of PWATaking the P out of PWA
Taking the P out of PWA
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReach
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worlds
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humans
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. Control
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)
 

Recently uploaded

Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 

Recently uploaded (20)

Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 

Open Hack London - Introduction to YQL

  • 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. hquot;p://www.flickr.com/photos/clspeace/162336973/
  • 6. And there is a lot of it around. hquot;p://www.flickr.com/photos/tudor/2981410947/
  • 7. However, our attempts to get to it can be clumsy. hquot;p://www.flickr.com/photos/lumachrome/2140368742/
  • 8. What we need is an easy way to get to that data. hquot;p://www.flickr.com/photos/carey@lden/115435226/
  • 9. We had a way to do that for quite a while now.
  • 11. Pipes, however is high end technology… hquot;p://www.flickr.com/photos/axio/2346342672/
  • 12. We’re developers, not interface users. hquot;p://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=quot;kittenquot;
  • 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=quot;kittenquot; 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} hquot;p://developer.yahoo.com/yql/guide/ authoriza@on‐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 London, UK, without a doubt. 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)
  • 31. Find Photos of London, UK 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. Find Photos of London, UK with a “By” CC license 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)
  • 33. Give me everything you know about these photos. 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)
  • 34. 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.
  • 36. 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=quot;stokeyquot;)
  • 37. select name,url from upcoming.venue where metro_id in (select id from upcoming.metro where search_text=quot;stokeyquot;)
  • 38. The diagnostics part of the returned data shows you what happened and how long it took
  • 39. Here’s what Yahoo offers you in this format: flickr.photos.exif local.search mybloglog.community.find flickr.photos.info music.ar0st.id mybloglog.member flickr.photos.interes0ngness music.ar0st.popular mybloglog.member.contacts flickr.photos.recent music.ar0st.search mybloglog.member.newwithcontacts flickr.photos.search music.ar0st.similar mybloglog.member.newwithme flickr.photos.sizes music.release.ar0st mybloglog.members.find flickr.places music.release.id mybloglog.stats.find flickr.places.info music.release.popular upcoming.category geo.places music.release.search upcoming.country geo.places.ancestors music.track.id upcoming.events geo.places.belongtos music.track.popular upcoming.events.bes0nplace geo.places.children music.track.search upcoming.groups geo.places.neighbors music.video.category upcoming.metro geo.places.parent music.video.id upcoming.state geo.places.siblings music.video.popular upcoming.user geo.placetypes music.video.search upcoming.venue gnip.ac0vity music.video.similar
  • 40. Here’s what Yahoo offers you in this format: search.images search.images search.images search.news search.news search.news search.siteexplorer.inlinks search.siteexplorer.inlinks search.siteexplorer.inlinks search.siteexplorer.pages search.siteexplorer.pages search.siteexplorer.pages search.spelling search.spelling search.spelling search.suggest search.suggest search.suggest search.termextract search.termextract search.termextract search.web search.web search.web social.connec0ons social.connec0ons social.connec0ons social.contacts social.contacts social.contacts social.presence social.presence social.presence social.profile social.profile social.profile social.updates social.updates social.updates weather.forecast weather.forecast weather.forecast yahoo.iden0ty yahoo.iden0ty yahoo.iden0ty yap.setsmallview yap.setsmallview yap.setsmallview
  • 41. You want even more? http://www.flickr.com/photos/verylastexcitingmoment/3123597774/
  • 42. Alright, how about this? json atom microformats csv rss feed xml html
  • 43. Telegraph’s headlines anyone? select * from html where url='http://www.telegraph.co.uk/' and xpath='//h3/a'
  • 45. You can dynamically create YQL queries to collate several sources…
  • 46. Then use cURL to pull them off the web with one single http request!
  • 47. YQL caches and compresses the results for you. Pretty easy, isn’t it?
  • 48. Here’s another fun part: Anyone can be part of the YQL interface.
  • 49. 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
  • 50. And people do… amazon nmm bitly nyt delicious opensocial dopplr search etsy shopping friendfeed social github twi?er Greader update.groovy guardian weather imdb wesabe iploca0on whitepages las>m yahoo nestoria yelp ne>lix zillow http://github.com/spullara/yql-tables/tree/master
  • 51. For example the national maritime museum: select * from nmm.archive.search where searchterm=‘horatio nelson'
  • 52. select * from nmm.archive.search where searchterm=‘horatio nelson'
  • 53. That’s pretty cool – allowing anyone to be part of this interface.
  • 54. The only shame is that you can’t do all the things in YQL that you can do in Pipes – for example string manipulation.
  • 55. We wondered how to make this possible. One thing we didn’t want to sacrifice is the simplicity of the language itself.
  • 56. So instead of inventing an own language, we decided to piggy-back on one you already know.
  • 57. 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
  • 58. For example you can augment an existing service to do something different.
  • 59. The following example adds a rank to search results. http://www.yqlblog.net/samples/searchrank.xml
  • 60.
  • 61.
  • 62. 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%'
  • 63.
  • 64. Anyways, the *easiest* way to start with YQL is to use the console. http://developer.yahoo.com/yql/console/
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74. Of course, you can also spend half the hack day reading API docs 
  • 75. Check out some code examples on. http://isithackday.com/hacks/ohd-london