SlideShare une entreprise Scribd logo
1  sur  78
Télécharger pour lire hors ligne
HACKING ON
STEROIDS WITH YQL
Saurabh Sahni
YDN Product Guy & Hacker
Twitter: @saurabhsahni
Hacking together
systems in 24 hours is
lot of fun.
Data manipulation
Hacks =           +
          Data visualization
The web has lot of data around
ProgrammableWeb.Com – 6831 APIs
Yahoo! has opened
   up its data
http://developer.yahoo.com/everything.html
THE TROUBLE WITH DATA
 •  You need to find data API
 •  Get Access – Signup for key
 •  Find data endpoint
 •  Read docs to learn what parameters you
    have
 •  Get data in obscure format
 •  Use data after converting and filtering
 •  More APIs you use, more is your
    annoyance
To make data
access easy on the
web, Yahoo!
created YQL
YQL turns web
services and data on
the web into
databases.
select {what} from {where}
    where {conditions}
You can select, filter,
sort and limit
You can even insert,
update and delete
from it.
FINDING VIDEOS ABOUT BANGALORE




SELECT * FROM youtube.search where
query='bangalore'
SELECTING PHOTOS OF HACKDAY




SELECT * FROM flickr.photos.search where
text="hackday” and api_key=“b5a60b2a…”
INSERTING DATA




INSERT INTO bitly.shorten (login, apiKey, longUrl)


VALUES ('ME', 'API_KEY', 'http://yahoo.com')
UPDATING DATA



 UPDATE social.profile.status


 SET status="Using YQL UPDATE”


 WHERE guid="NJFIDHVPVVISDX7UKED2WHU"
RETRIEVING MY CONTACTS




SELECT * FROM social.contacts WHERE
guid=me
ACCESSING PRIVATE DATA
        http://query.yahooapis.com/v1/yql

Uses OAuth 1.0 for authorization

OAuth is complicated – use one of our SDKs at
https://github.com/yahoo
You can also mix and
match several web
services using the in()
command.
select * from search.termextract
where context in (select
description from rss where
url='http://rss.news.yahoo.com/
rss/topstories')
Almost all the top
APIs on web are
accessible from YQL
Some	
  of	
  them	
  
amazon                   foursquare   peerindex
apple                    geo          salesforce
bbc                      github       slideshare
bible                    google       themovideb
boss                     hackernews   tumblr
campfire                 ign          twitter
contentanalysis          intuit       vimeo
craigslist               kiva         weather
delicious                klout        yahoo
dopplr                   lastfm       youtube
etsy                     netflix      zillow
facebook                 paypal
You want even
more?
Alright, how about this?


   atom           json
   csv            microformats
   feed           rss
   html           xml
The easiest way to
start with YQL is to
use the console
http://developer.yahoo.com/yql/
console
YQL: http://developer.yahoo.com/yql/console
How to get this data
in your app?
YQL is a REST API
in itself and 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}
Output formats are XML
or JSON
LET’S SEE IT
QUERY EXAMPLES



                 select	
  *	
  from	
  
                 yahoo.finance.quotes	
  
                 where	
  symbol	
  in	
  
                 ("^IXIC","^DJI","YHOO
                 ","AAPL")	
  
QUERY EXAMPLES


                 select	
  *	
  from	
  
                 weather.bylocaHon	
  where	
  
                 locaHon	
  in	
  ("bangalore,	
  in",	
  
                 ”new	
  york,	
  us")	
  
QUERY EXAMPLES
Find hackday tweets:
SELECT * FROM twitter.search where q='hackday’

Search Yahoo! Answers for resolved questions about cars:
select * from answers.search where query="cars" and type="resolved”


Find distance between Bangalore and Mumbai:
select * from geo.distance where place1="bangalore" and
place2="mumbai”


Extract important terms from top stories on Yahoo! news:
select * from search.termextract where context in (select description
from rss where url='http://rss.news.yahoo.com/rss/topstories')
QUERY EXAMPLES

Get Olympic medal list
select * from html where url='http://sports.yahoo.com/olympics/
medals.html' and xpath='//*[@id='mediasportsoverallmedalcount']/div
[2]/table/tbody/tr/td/a'

Shorten a URL:
insert into yahoo.y.ahoo.it (url, keysize) values ('http://
www.javarants.com', 5)

Search apartments in criagslist:
select * from craigslist.search where location="bangalore" and
type="apa" and query="indiranagar”
QUERY EXAMPLES

Scrape news from Yahoo! Finance:
select * from html where url="http://finance.yahoo.com/q?
s=yhoo" and xpath='//div[@id="yfi_headlines"]/div[2]/ul/li/a’


Select, filter data from google spreadsheets:
select * from csv where url="https://
spreadsheets.google.com/pub?key=0ArYndzim-
lbrdF8wc3A5QWl1ZGRpdkxRZk80SU9zUXc&output=csv"
and col5 like 'Bangalore%’ ;
Let’s find hackday
photos on flickr
How about limiting
to those clicked in
Bangalore
MAKING REQUESTS: FLICKR URLS

 <photo farm="3"
        id="5708163920"
        isfamily="0"
        isfriend="0"
        ispublic="1"
        owner="31832337@N04"
        secret="0075137487"
        server="2496"
        title="San Francisco"/>
MAKING REQUESTS: FLICKR URLS

 Photo URL	
  
 http://farm{$farm}.static.flickr.com/{$server}/
 {$id}_{$secret}.jpg


 Photo Page URL	
  
 http://www.flickr.com/photos/{$owner}/{$id}


 Photo Owner Profile URL	
  
 http://www.flickr.com/photos/{$owner}
https://github.com/saurabhsahni/Hacks/
Finding Recent Photos from flickr
Some YQL Hacks
ChromYQLip is a
chrome extension for
page scraping via YQL
Open	
  Hack	
  Bangalore	
  2010	
  Winner	
  
http://bit.ly/chromeYQL
VIDEO CLIP
http://www.webmeme.in
WEBMEME.IN

Fetch multiple feeds in different formats like atom, RSS and
transform them into consistent RSS format
Select * from rss where url in (‘http://feeds.feedburner.com/pluggd’,
‘http://quatrainman.blogspot.com/atom.xml’, ‘…’)


Filter news containing “india” from multiple feeds:
select * from rss where url in ('http://feeds.feedburner.com/
TechCrunch', 'http://www.readwriteweb.com/rss.xml','http://
gigaom.com/feed/') and description like '%india%’
YQL is open – you
can get your data
tables in our system
All you need to do is
write an XML
schema and put it
on Github.
http://github.com/yql/yql-tables
Here is the craigslist
search table
https://github.com/yql/yql-tables/tree/master/
craigslist/craigslist.search.xml
USE INSTANTLY BY UPLOADING ON YOUR
SITE



  USE 'http://www.mysite.com/my_table.xml'
  AS mytable;
  SELECT * FROM mytable
  WHERE user='saurabh'
You can even write
server side
javascript to build a
webservice or
augment one.
hLp://developer.yahoo.com/yql/guide/yql-­‐execute-­‐chapter.html	
  
There are lot of
things you can do
with YQL.
Play yourself
http://
developer.yahoo.com/yql/
One more thing
RESOURCES
All Yahoo! APIs and Services
http://developer.yahoo.com/everything.html

YQL Documentation
http://developer.yahoo.com/yql

YQL Console
http://developer.yahoo.com/yql/console

YQL Github Account (Contribute Tables)
http://github.com/yql/yql-tables
THANKS!

http://www.slideshare.net/
saurabhsahni




 Saurabh Sahni

 Twitter: @saurabhsahni
 Github: http://github.com/saurabhsahni
 Web: http://www.saurabhsahni.com
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012

Contenu connexe

Tendances

Poisoning Google images
Poisoning Google imagesPoisoning Google images
Poisoning Google imageslukash4
 
Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing CapybaraTim Moore
 
Functional testing with capybara
Functional testing with capybaraFunctional testing with capybara
Functional testing with capybarakoffeinfrei
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015Ron White
 
Djangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationDjangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationMasashi Shibata
 
Web Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.KeyWeb Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.Keyjtzemp
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on railsMatteo Collina
 
Finding things on the web with BOSS
Finding things on the web with BOSSFinding things on the web with BOSS
Finding things on the web with BOSSChristian Heilmann
 
Web Scraping is BS
Web Scraping is BSWeb Scraping is BS
Web Scraping is BSJohn D
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015Matt Raible
 
Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Masashi Shibata
 

Tendances (14)

AWS Elastic Beanstalk
AWS Elastic BeanstalkAWS Elastic Beanstalk
AWS Elastic Beanstalk
 
Poisoning Google images
Poisoning Google imagesPoisoning Google images
Poisoning Google images
 
Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing Capybara
 
Functional testing with capybara
Functional testing with capybaraFunctional testing with capybara
Functional testing with capybara
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015
 
Djangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationDjangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django application
 
Api
ApiApi
Api
 
Web Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.KeyWeb Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.Key
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on rails
 
YQL - HackU IIT Madras 2012
YQL - HackU IIT Madras 2012YQL - HackU IIT Madras 2012
YQL - HackU IIT Madras 2012
 
Finding things on the web with BOSS
Finding things on the web with BOSSFinding things on the web with BOSS
Finding things on the web with BOSS
 
Web Scraping is BS
Web Scraping is BSWeb Scraping is BS
Web Scraping is BS
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
 
Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018
 

Similaire à YQL: Hacking on steroids - Yahoo! Open Hack Day 2012

YQL: Master Of the Mix
YQL: Master Of the MixYQL: Master Of the Mix
YQL: Master Of the Mixmarkandey
 
Select * from internet
Select * from internetSelect * from internet
Select * from internetmarkandey
 
Hack u iitb_social
Hack u iitb_socialHack u iitb_social
Hack u iitb_socialRajesh Kumar
 
YDN KR Tech Talk : Pipes 와 YQL 활용하기
YDN KR Tech Talk : Pipes 와 YQL 활용하기YDN KR Tech Talk : Pipes 와 YQL 활용하기
YDN KR Tech Talk : Pipes 와 YQL 활용하기Jinho Jung
 
YQL Presentation at Geek Girls Dinner Sydney
YQL Presentation at Geek Girls Dinner SydneyYQL Presentation at Geek Girls Dinner Sydney
YQL Presentation at Geek Girls Dinner SydneyPratibha Gannavarapu
 
Query the web with YQL
Query the web with YQLQuery the web with YQL
Query the web with YQLramace
 
Lessons Learned - Building YDN
Lessons Learned - Building YDNLessons Learned - Building YDN
Lessons Learned - Building YDNDan Theurer
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approvalSimon Willison
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis HackdayPaul Donnelly
 
Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQLChristian Heilmann
 
Participating in the Web of Data
Participating in the Web of DataParticipating in the Web of Data
Participating in the Web of DataChristian Heilmann
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internetdrgath
 
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
 
Open Hack NYC Yahoo Social SDKs
Open Hack NYC Yahoo Social SDKsOpen Hack NYC Yahoo Social SDKs
Open Hack NYC Yahoo Social SDKsDustin Whittle
 
YQL and Geo
YQL and GeoYQL and Geo
YQL and Geomambo91
 

Similaire à YQL: Hacking on steroids - Yahoo! Open Hack Day 2012 (20)

YQL & Yahoo! Apis
YQL & Yahoo! ApisYQL & Yahoo! Apis
YQL & Yahoo! Apis
 
Yql with geo
Yql with geoYql with geo
Yql with geo
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
YQL: Master Of the Mix
YQL: Master Of the MixYQL: Master Of the Mix
YQL: Master Of the Mix
 
Select * from internet
Select * from internetSelect * from internet
Select * from internet
 
Hack u iitb_social
Hack u iitb_socialHack u iitb_social
Hack u iitb_social
 
YDN KR Tech Talk : Pipes 와 YQL 활용하기
YDN KR Tech Talk : Pipes 와 YQL 활용하기YDN KR Tech Talk : Pipes 와 YQL 활용하기
YDN KR Tech Talk : Pipes 와 YQL 활용하기
 
YQL Presentation at Geek Girls Dinner Sydney
YQL Presentation at Geek Girls Dinner SydneyYQL Presentation at Geek Girls Dinner Sydney
YQL Presentation at Geek Girls Dinner Sydney
 
Query the web with YQL
Query the web with YQLQuery the web with YQL
Query the web with YQL
 
Lessons Learned - Building YDN
Lessons Learned - Building YDNLessons Learned - Building YDN
Lessons Learned - Building YDN
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approval
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis Hackday
 
Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQL
 
Participating in the Web of Data
Participating in the Web of DataParticipating in the Web of Data
Participating in the Web of Data
 
YQL:: Select * from Internet
YQL:: Select * from InternetYQL:: Select * from Internet
YQL:: Select * from Internet
 
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
 
SEA Open Hack - YQL
SEA Open Hack - YQLSEA Open Hack - YQL
SEA Open Hack - YQL
 
Open Hack NYC Yahoo Social SDKs
Open Hack NYC Yahoo Social SDKsOpen Hack NYC Yahoo Social SDKs
Open Hack NYC Yahoo Social SDKs
 
YQL and Geo
YQL and GeoYQL and Geo
YQL and Geo
 
Technical Introduction to YDN
Technical Introduction to YDNTechnical Introduction to YDN
Technical Introduction to YDN
 

Plus de Saurabh Sahni

Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYC
Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYCHacking 101 & Yahoo Mobile Developer Suite - YMDC NYC
Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYCSaurabh Sahni
 
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...Saurabh Sahni
 
Finding things on the web with Yahoo! BOSS: IIT Delhi
Finding things on the web with Yahoo! BOSS: IIT DelhiFinding things on the web with Yahoo! BOSS: IIT Delhi
Finding things on the web with Yahoo! BOSS: IIT DelhiSaurabh Sahni
 
Hacking for Innovation - WPP, New York
Hacking for Innovation - WPP, New YorkHacking for Innovation - WPP, New York
Hacking for Innovation - WPP, New YorkSaurabh Sahni
 
Innovating the Hacker Way
Innovating the Hacker WayInnovating the Hacker Way
Innovating the Hacker WaySaurabh Sahni
 
Finding things with BOSS
Finding things with BOSSFinding things with BOSS
Finding things with BOSSSaurabh Sahni
 
Let the hacking continue - Post Open Hack India Mixer
Let the hacking continue - Post Open Hack India MixerLet the hacking continue - Post Open Hack India Mixer
Let the hacking continue - Post Open Hack India MixerSaurabh Sahni
 
Hack 101 - IIT Delhi HackU 2011
Hack 101 - IIT Delhi HackU 2011Hack 101 - IIT Delhi HackU 2011
Hack 101 - IIT Delhi HackU 2011Saurabh Sahni
 
Yahoo! Open Stack & YQL
Yahoo! Open Stack & YQLYahoo! Open Stack & YQL
Yahoo! Open Stack & YQLSaurabh Sahni
 
Hacking for Innovation: IIT Kharagpur
Hacking for Innovation: IIT KharagpurHacking for Innovation: IIT Kharagpur
Hacking for Innovation: IIT KharagpurSaurabh Sahni
 
Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011Saurabh Sahni
 
HackU: IIT Madras: Hacking Yahoo! Social
HackU: IIT Madras: Hacking Yahoo! SocialHackU: IIT Madras: Hacking Yahoo! Social
HackU: IIT Madras: Hacking Yahoo! SocialSaurabh Sahni
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialSaurabh Sahni
 
Hackuzela: Hacking Yahoo! Social
Hackuzela: Hacking Yahoo! SocialHackuzela: Hacking Yahoo! Social
Hackuzela: Hacking Yahoo! SocialSaurabh Sahni
 
BOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT HyderabadBOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT HyderabadSaurabh Sahni
 
BOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT BangaloreBOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT BangaloreSaurabh Sahni
 
BOSS Open Hack Day, Bangalore
BOSS Open Hack Day, BangaloreBOSS Open Hack Day, Bangalore
BOSS Open Hack Day, BangaloreSaurabh Sahni
 
BOSS: HackU IIT Bombay
BOSS: HackU IIT BombayBOSS: HackU IIT Bombay
BOSS: HackU IIT BombaySaurabh Sahni
 
BOSS: HackU IIT Delhi
BOSS: HackU IIT DelhiBOSS: HackU IIT Delhi
BOSS: HackU IIT DelhiSaurabh Sahni
 

Plus de Saurabh Sahni (20)

Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYC
Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYCHacking 101 & Yahoo Mobile Developer Suite - YMDC NYC
Hacking 101 & Yahoo Mobile Developer Suite - YMDC NYC
 
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
 
Finding things on the web with Yahoo! BOSS: IIT Delhi
Finding things on the web with Yahoo! BOSS: IIT DelhiFinding things on the web with Yahoo! BOSS: IIT Delhi
Finding things on the web with Yahoo! BOSS: IIT Delhi
 
Hacking 101
Hacking 101Hacking 101
Hacking 101
 
Hacking for Innovation - WPP, New York
Hacking for Innovation - WPP, New YorkHacking for Innovation - WPP, New York
Hacking for Innovation - WPP, New York
 
Innovating the Hacker Way
Innovating the Hacker WayInnovating the Hacker Way
Innovating the Hacker Way
 
Finding things with BOSS
Finding things with BOSSFinding things with BOSS
Finding things with BOSS
 
Let the hacking continue - Post Open Hack India Mixer
Let the hacking continue - Post Open Hack India MixerLet the hacking continue - Post Open Hack India Mixer
Let the hacking continue - Post Open Hack India Mixer
 
Hack 101 - IIT Delhi HackU 2011
Hack 101 - IIT Delhi HackU 2011Hack 101 - IIT Delhi HackU 2011
Hack 101 - IIT Delhi HackU 2011
 
Yahoo! Open Stack & YQL
Yahoo! Open Stack & YQLYahoo! Open Stack & YQL
Yahoo! Open Stack & YQL
 
Hacking for Innovation: IIT Kharagpur
Hacking for Innovation: IIT KharagpurHacking for Innovation: IIT Kharagpur
Hacking for Innovation: IIT Kharagpur
 
Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011
 
HackU: IIT Madras: Hacking Yahoo! Social
HackU: IIT Madras: Hacking Yahoo! SocialHackU: IIT Madras: Hacking Yahoo! Social
HackU: IIT Madras: Hacking Yahoo! Social
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! Social
 
Hackuzela: Hacking Yahoo! Social
Hackuzela: Hacking Yahoo! SocialHackuzela: Hacking Yahoo! Social
Hackuzela: Hacking Yahoo! Social
 
BOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT HyderabadBOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT Hyderabad
 
BOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT BangaloreBOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT Bangalore
 
BOSS Open Hack Day, Bangalore
BOSS Open Hack Day, BangaloreBOSS Open Hack Day, Bangalore
BOSS Open Hack Day, Bangalore
 
BOSS: HackU IIT Bombay
BOSS: HackU IIT BombayBOSS: HackU IIT Bombay
BOSS: HackU IIT Bombay
 
BOSS: HackU IIT Delhi
BOSS: HackU IIT DelhiBOSS: HackU IIT Delhi
BOSS: HackU IIT Delhi
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

YQL: Hacking on steroids - Yahoo! Open Hack Day 2012

  • 1.
  • 2. HACKING ON STEROIDS WITH YQL Saurabh Sahni YDN Product Guy & Hacker Twitter: @saurabhsahni
  • 3.
  • 4. Hacking together systems in 24 hours is lot of fun.
  • 5. Data manipulation Hacks = + Data visualization
  • 6. The web has lot of data around
  • 8. Yahoo! has opened up its data
  • 10. THE TROUBLE WITH DATA •  You need to find data API •  Get Access – Signup for key •  Find data endpoint •  Read docs to learn what parameters you have •  Get data in obscure format •  Use data after converting and filtering •  More APIs you use, more is your annoyance
  • 11. To make data access easy on the web, Yahoo! created YQL
  • 12. YQL turns web services and data on the web into databases.
  • 13. select {what} from {where} where {conditions}
  • 14. You can select, filter, sort and limit
  • 15. You can even insert, update and delete from it.
  • 16. FINDING VIDEOS ABOUT BANGALORE SELECT * FROM youtube.search where query='bangalore'
  • 17. SELECTING PHOTOS OF HACKDAY SELECT * FROM flickr.photos.search where text="hackday” and api_key=“b5a60b2a…”
  • 18. INSERTING DATA INSERT INTO bitly.shorten (login, apiKey, longUrl) VALUES ('ME', 'API_KEY', 'http://yahoo.com')
  • 19. UPDATING DATA UPDATE social.profile.status SET status="Using YQL UPDATE” WHERE guid="NJFIDHVPVVISDX7UKED2WHU"
  • 20. RETRIEVING MY CONTACTS SELECT * FROM social.contacts WHERE guid=me
  • 21. ACCESSING PRIVATE DATA http://query.yahooapis.com/v1/yql Uses OAuth 1.0 for authorization OAuth is complicated – use one of our SDKs at https://github.com/yahoo
  • 22. You can also mix and match several web services using the in() command.
  • 23. select * from search.termextract where context in (select description from rss where url='http://rss.news.yahoo.com/ rss/topstories')
  • 24. Almost all the top APIs on web are accessible from YQL
  • 25.
  • 26. Some  of  them   amazon foursquare peerindex apple geo salesforce bbc github slideshare bible google themovideb boss hackernews tumblr campfire ign twitter contentanalysis intuit vimeo craigslist kiva weather delicious klout yahoo dopplr lastfm youtube etsy netflix zillow facebook paypal
  • 28. Alright, how about this? atom json csv microformats feed rss html xml
  • 29. The easiest way to start with YQL is to use the console http://developer.yahoo.com/yql/ console
  • 31.
  • 32.
  • 33.
  • 34. How to get this data in your app?
  • 35. YQL is a REST API in itself and has two endpoints
  • 36. The public endpoint does not need any authentication. http://query.yahooapis.com/v1/public/ yql?q={query} &format={format}
  • 37. The private endpoint needs oauth authentication. http://query.yahooapis.com/v1/yql?q= {query}&format={format}
  • 38. Output formats are XML or JSON
  • 40. QUERY EXAMPLES select  *  from   yahoo.finance.quotes   where  symbol  in   ("^IXIC","^DJI","YHOO ","AAPL")  
  • 41. QUERY EXAMPLES select  *  from   weather.bylocaHon  where   locaHon  in  ("bangalore,  in",   ”new  york,  us")  
  • 42. QUERY EXAMPLES Find hackday tweets: SELECT * FROM twitter.search where q='hackday’ Search Yahoo! Answers for resolved questions about cars: select * from answers.search where query="cars" and type="resolved” Find distance between Bangalore and Mumbai: select * from geo.distance where place1="bangalore" and place2="mumbai” Extract important terms from top stories on Yahoo! news: select * from search.termextract where context in (select description from rss where url='http://rss.news.yahoo.com/rss/topstories')
  • 43. QUERY EXAMPLES Get Olympic medal list select * from html where url='http://sports.yahoo.com/olympics/ medals.html' and xpath='//*[@id='mediasportsoverallmedalcount']/div [2]/table/tbody/tr/td/a' Shorten a URL: insert into yahoo.y.ahoo.it (url, keysize) values ('http:// www.javarants.com', 5) Search apartments in criagslist: select * from craigslist.search where location="bangalore" and type="apa" and query="indiranagar”
  • 44. QUERY EXAMPLES Scrape news from Yahoo! Finance: select * from html where url="http://finance.yahoo.com/q? s=yhoo" and xpath='//div[@id="yfi_headlines"]/div[2]/ul/li/a’ Select, filter data from google spreadsheets: select * from csv where url="https:// spreadsheets.google.com/pub?key=0ArYndzim- lbrdF8wc3A5QWl1ZGRpdkxRZk80SU9zUXc&output=csv" and col5 like 'Bangalore%’ ;
  • 46. How about limiting to those clicked in Bangalore
  • 47.
  • 48. MAKING REQUESTS: FLICKR URLS <photo farm="3" id="5708163920" isfamily="0" isfriend="0" ispublic="1" owner="31832337@N04" secret="0075137487" server="2496" title="San Francisco"/>
  • 49. MAKING REQUESTS: FLICKR URLS Photo URL   http://farm{$farm}.static.flickr.com/{$server}/ {$id}_{$secret}.jpg Photo Page URL   http://www.flickr.com/photos/{$owner}/{$id} Photo Owner Profile URL   http://www.flickr.com/photos/{$owner}
  • 50.
  • 52. Finding Recent Photos from flickr
  • 54.
  • 55.
  • 56. ChromYQLip is a chrome extension for page scraping via YQL Open  Hack  Bangalore  2010  Winner  
  • 60. WEBMEME.IN Fetch multiple feeds in different formats like atom, RSS and transform them into consistent RSS format Select * from rss where url in (‘http://feeds.feedburner.com/pluggd’, ‘http://quatrainman.blogspot.com/atom.xml’, ‘…’) Filter news containing “india” from multiple feeds: select * from rss where url in ('http://feeds.feedburner.com/ TechCrunch', 'http://www.readwriteweb.com/rss.xml','http:// gigaom.com/feed/') and description like '%india%’
  • 61. YQL is open – you can get your data tables in our system
  • 62. All you need to do is write an XML schema and put it on Github.
  • 64. Here is the craigslist search table https://github.com/yql/yql-tables/tree/master/ craigslist/craigslist.search.xml
  • 65.
  • 66. USE INSTANTLY BY UPLOADING ON YOUR SITE USE 'http://www.mysite.com/my_table.xml' AS mytable; SELECT * FROM mytable WHERE user='saurabh'
  • 67. You can even write server side javascript to build a webservice or augment one. hLp://developer.yahoo.com/yql/guide/yql-­‐execute-­‐chapter.html  
  • 68. There are lot of things you can do with YQL.
  • 71.
  • 72. RESOURCES All Yahoo! APIs and Services http://developer.yahoo.com/everything.html YQL Documentation http://developer.yahoo.com/yql YQL Console http://developer.yahoo.com/yql/console YQL Github Account (Contribute Tables) http://github.com/yql/yql-tables
  • 73. THANKS! http://www.slideshare.net/ saurabhsahni Saurabh Sahni Twitter: @saurabhsahni Github: http://github.com/saurabhsahni Web: http://www.saurabhsahni.com