Yql ans geo
Upcoming SlideShare
Loading in...5
×
 

Yql ans geo

on

  • 473 views

 

Statistics

Views

Total Views
473
Views on SlideShare
473
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Photo from http://www.flickr.com/photos/han_shot_first/6573340265/
  • Photo from http://www.flickr.com/photos/han_shot_first/6573340265/
  • It is a way to access the data from the internetSimple to learnSQL like syntaxDesc tables
  • YQL is the bridge which converts unstructured data into structured data which can be then consumed by your application
  • YQL provides the output in 2 formats
  • https://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=html
  • http://developer.yahoo.com/yql/console/#h=select%20*%20from%20social.profile%20where%20guid%20%3D%20mehttp://developer.yahoo.com/yql/console/#h=select%20*%20from%20flickr.photos.search%20where%20api_key%3D%22...%22%20and%20text%3D%22san%20francisco%22
  • http://developer.yahoo.com/yql/console/#h=select%20*%20from%20contentanalysis.analyze%20where%20text%20%3D%20%22But%20just%20when%20thoughts%20of%20last%20September%27s%20U.S.%20Open%20final%20started%20flashing%20though%20the%20mind%20of%20everyone%20packed%20on%20to%20Centre%20Court%2C%20when%20Djokovic%20rallied%20to%20win%20the%20third%20and%20fourth%20sets%2C%20Murray%20made%20sure%20that%20there%20would%20be%20no%20repeat.%22
  • http://developer.yahoo.com/yql/console/#h=select%20*%20from%20contentanalysis.analyze%20where%20text%20%3D%20%22But%20just%20when%20thoughts%20of%20last%20September%27s%20U.S.%20Open%20final%20started%20flashing%20though%20the%20mind%20of%20everyone%20packed%20on%20to%20Centre%20Court%2C%20when%20Djokovic%20rallied%20to%20win%20the%20third%20and%20fourth%20sets%2C%20Murray%20made%20sure%20that%20there%20would%20be%20no%20repeat.%22
  • Photo from http://www.flickr.com/photos/brickultra/7178444546/sizes/o/in/photostream/
  • http://developer.yahoo.com/yql/guide/joins.html
  • http://developer.yahoo.com/yql/console/#h=select%20content%20from%20html%20where%20url%3D%22http%3A//in.news.yahoo.com/murray-takes-two-set-lead-final-against-djokovic-153758871.html%22%20and%20xpath%3D%27//*%5B@id%3D%22mediaarticlebody%22%5D/div/p%5B29%5D%27
  • http://developer.yahoo.com/yql/console/#h=select%20entity%20from%20contentanalysis.analyze%20where%20text%20IN%20%28select%20content%20from%20html%20where%20url%3D%22http%3A//in.news.yahoo.com/murray-takes-two-set-lead-final-against-djokovic-153758871.html%22%20and%20xpath%3D%27//*%5B@id%3D%22mediaarticlebody%22%5D/div/p%5B29%5D%27%29
  • http://developer.yahoo.com/yql/console/#h=select%20*%20from%20flickr.photos.search%20where%20api_key%3D%22…%22%20and%20text%20IN%20%28select%20entity%20from%20contentanalysis.analyze%20where%20text%20IN%20%28select%20content%20from%20html%20where%20url%3D%22http%3A//in.news.yahoo.com/murray-takes-two-set-lead-final-against-djokovic-153758871.html%22%20and%20xpath%3D%27//*%5B@id%3D%22mediaarticlebody%22%5D/div/p%5B29%5D%27%29%29
  • Photo from http://www.flickr.com/photos/prodiffusion/8267223638/
  • http://www.flickr.com/photos/funkyporcupine/8290971054/sizes/l/in/photostream/
  • http://developer.yahoo.com/answers/
  • Photo from http://www.flickr.com/photos/carthalis/3562768042/sizes/o/in/photostream/
  • http://isithackday.com/hacks/geo/js-location.html
  • Photo from http://www.flickr.com/photos/brickaholicproductions/5177947158/sizes/l/in/photostream/

Yql ans geo Yql ans geo Presentation Transcript

  • http://www.flickr.com/photos/han_shot_first/6573340265/
  • YQL 1 API to rule them all http://www.flickr.com/photos/han_shot_first/6573340265/
  • What • YQL is Yahoo! Query Language – Web service – SQL like syntax – SELECT * FROM internet;
  • What Unstructured data Data via YQL
  • Console
  • Console Tables are here
  • Console Your query goes here
  • Console Output is here
  • Console Take-away URL here
  • Output • XML – Human & machine readable • JSON – Javascript object notation – A JS object {} • Key, value pairs including arrays – Callback supported • func_name({“json”:”object”})
  • Output
  • Unstructured data • Page scrapping • select content from html where url="http://in.news.yahoo.com/murray-takes-two- set-lead-final-against-djokovic-153758871.html" and xpath='//*[@id="mediaarticlebody"]/div/p[29]’ • Xpath – path to a node in an XML document
  • Unstructured data • Reading google spreadsheets • https://docs.google.com/spreadsheet/pub?key=0A gGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnI xeUE&output=csv • select * from csv where url = ””
  • Why • Unstructured data – Yes, YQL is cool. But … • Why use YQL – When webservices are already available • Lets see why, via an example
  • Example – Profile, Flickr • !YQL – Get a user profile • http://social.yahooapis.com/v1/user/{guid}/profile – Search for photos in flickr • http://api.flickr.com/services/rest/?method=flickr.ph otos.search&api_key=…&text=djokovic&format=re st
  • Example – Profile, Flickr • YQL – Get a user profile • select * from social.profile where guid = me – Search for photos in flickr • select * from flickr.photos.search where api_key="..." and text="san francisco"
  • Examples – Content Analysis
  • Examples – Content Analysis
  • Unstructured data, easy api access. What else? http://www.flickr.com/photos/brickultra/7178444546/
  • SQL like… JOINS? • YQL does not support joins natively • Supports sub-selects – Let’s look at an example
  • SQL like… JOINS? 1. Get content from a web page
  • SQL like… JOINS? 2. Identify entities in that content
  • SQL like… JOINS? 3. Search for photos with entity names
  • SQL like… JOINS? • A small demo – http://doc1.ydn.gq1.yahoo.com/mybloglog_test/yqljoin.html – JOINs doesn’t mean single API call • YQL still makes multiple calls – Only one IN allowed per select • Sub-select can also have one IN
  • How? – Devil is in the details http://www.flickr.com/photos/prodiffusion/8267223638/
  • How to use • PHP $yql_query = "select * from answers.getbycategory where category_id=2115500137"; $yql_url = "http://query.yahooapis.com/v1/public/yql?q=" . rawurlencode($yql_query) . "&format=json"; $session = curl_init($yql_url); curl_setopt($session, CURLOPT_RETURNTRANSFER,true); $json = curl_exec($session);
  • How to use • Javascript
  • Ask. Answer. Discover Y! Answers http://www.flickr.com/photos/funkyporcupine/8290971054/
  • Answers - Tables
  • http://developer.yahoo.com/answers/
  • Where, what’s there and how to reach Geo http://www.flickr.com/photos/carthalis/3562768042/
  • Current Location - Ask • Ask the user
  • Current Location - Ask • Ask the browser
  • Current Location - Ask
  • Current Location - Sniff http://isithackday.com/hacks/geo/js-location.html
  • Geocoding
  • Reverse geocoding
  • Woeid • Where-On-Earth-ID
  • Woeid SELECT placeTypeName, name FROM geo.places.ancestors WHERE descendant_woeid = "55925520” SELECT placeTypeName, name FROM geo.places.ancestors WHERE descendant_woeid = "55925520”
  • Geoplanet
  • Placemaker
  • Geo Hacks • http://trendsmap.com/local/india • http://isithackday.com/hacks/geo/
  • Happy hacking! Thank You http://www.flickr.com/photos/brickaholicproductions/5177947158/