SlideShare a Scribd company logo
YQL: Find more than just data

           Philip Tellis / philip@bluesmoon.info


      Yahoo!7 Open Session – 11 May 2010 – #y7os




Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
$ finger philip




      Philip Tellis
      philip@bluesmoon.info
      @bluesmoon
      yahoo
      geek
      http://bluesmoon.info/




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
missingkids.com




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
missingkidsmap.com




      http://www.missingkidsmap.com/read.php?state=CA




    Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
<locations>
   <maplocation zoom="5"
                state_long="-119.838867"
                state_lat="37.370157"/>
   <location id="1"
             firstname="Anastasia"
             lastname=" Shearer "
             picture="img width=160 target=_new src=http://www.missingkids.com/photographs/NCM
             picture2="img width=160 target=_new src=http://www.missingkids.com/photographs/NC
             medpic = "img width=60 border=0 target=_new src=http://www.missingkids.com/photog
             smallpic="img width=30 border=0 target=_new src=http://www.missingkids.com/photog
             policenum="1-661-861-3110"
             policeadd="Kern County Sheriff´ Office (California)"
                                           s
             policenum2=""
             policeadd2=""
             st=" CA"
             city="BAKERSFIELD"
             missing="12/26/2009"
             status="Endangered Runaway"
             age="16"
             url="1140669"
             lat="35.3733333333333"
             lng="-119.017777777778"/>
   ...
</locations>




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Death by 404


    API call on every 404 page =⇒




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
This looks like a job for...




  YQLCAT




      Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
SELECT




 SELECT * From xml Where
 url=’http://www.missingkidsmap.com/read.php?state=ZZ’




    Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Geo




 More useful if we find local kids




      Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
YQL can do it




               SELECT * From ip.location Where ip=@ip




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
{
    "query":{
     ...
     "results":{
      "Response":{
        "Ip":"209.117.47.253",
        "Status":"OK",
        "CountryCode":"US",
        "CountryName":"United States",
        "RegionCode":null,
        "RegionName":null,
        "City":null,
        "ZipPostalCode":null,
        "Latitude":"38",
        "Longitude":"-97",
        "Timezone":"-6",
        "Gmtoffset":"-6",
        "Dstoffset":"-5"
      }
      Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
WoEID




 SELECT place.woeid From flickr.places
 Where lat=@lat And lon=@lon




    Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
WoEID




 SELECT place.woeid From flickr.places
 Where (lat, lon) IN
 (
 SELECT Latitude, Longitude From ip.location
 Where ip=@ip
 )




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
{
    "query":{
     "count":"1",
     ...
     "results":{
       "places":{
        "place":{
          "woeid":"12588378"
        }
       }
     }
    }
}




      Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Country/State




  SELECT country.code, admin1.code
  From geo.places
  Where woeid=@woeid




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
All together



  SELECT country.code, admin1.code From geo.places
   Where woeid IN
     (
        SELECT place.woeid From flickr.places
         Where (lat, lon) IN
           (
              SELECT Latitude, Longitude
                From ip.location
               Where ip=@ip
           )
     )




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
{
    "query":{
     "count":"1",
     ...
     "results":{
       "place":{
        "country":{
          "code":"US"
        },
        "admin1":{
          "code":"US-KS"
        }
       }
     }
    }
}


      Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
And that’s it




      Throw in a bit of PHP to turn the JSON into HTML
      CSS to style it
      Wrap it in your page template
      eg: http://bluesmoon.info/foobar




      Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
PHP


 $json = http_get($missing_kids_url);
 $o = json_decode($json, 1);
 $children = $o[’query’][’results’]
                    [’locations’][’location’];

 $child = array_rand($children);

 print_404($child);

 ...

 header(’HTTP/1.0 404 Not Found’);




       Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
ErrorDocument 404 /404.php




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Links




        http://tech.bluesmoon.info/2010/02/convert-ip-to-geo-info-
        using-yql.html
        http://tech.bluesmoon.info/2010/02/missing-kids-on-your-
        404-page.html
        http://developer.yahoo.com/yql/
        http://www.missingkidsmap.com/




        Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Photo credits




     http://lolcats.com/view/11439/
     http://lolcats.com/view/13347/
     http://www.flickr.com/photos/wwworks/440672445/




     Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data
Thank you




     Philip Tellis
     philip@bluesmoon.info
     @bluesmoon
     http://bluesmoon.info/
     slideshare.net/bluesmoon




    Yahoo!7 Open Session – 11 May 2010 – #y7os   YQL: Find more than just data

More Related Content

What's hot

Concept History
Concept HistoryConcept History
Concept History
jonphipps
 
Hebrew Bible as Data: Laboratory, Sharing, Lessons
Hebrew Bible as Data: Laboratory, Sharing, LessonsHebrew Bible as Data: Laboratory, Sharing, Lessons
Hebrew Bible as Data: Laboratory, Sharing, Lessons
Dirk Roorda
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
Davide Rapacciuolo
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
Antonio Pellegrino
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
 
API Pain Points (PHPNE)
API Pain Points (PHPNE)API Pain Points (PHPNE)
API Pain Points (PHPNE)
Phil Sturgeon
 
01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started
OpenThink Labs
 
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
elevenma
 
JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFEJSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
Hiroyuki Anai
 
анатолий шарифулин Mojolicious
анатолий шарифулин Mojoliciousанатолий шарифулин Mojolicious
анатолий шарифулин Mojolicious
rit2010
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the Good
Jeremy Kendall
 
JSON-LD for RESTful services
JSON-LD for RESTful servicesJSON-LD for RESTful services
JSON-LD for RESTful services
Markus Lanthaler
 
E Records Resource Recommendations
E Records Resource RecommendationsE Records Resource Recommendations
E Records Resource Recommendations
Ken Matthews
 
The Web, one huge database ...
The Web, one huge database ...The Web, one huge database ...
The Web, one huge database ...
Michael Hausenblas
 
Api pain points
Api pain pointsApi pain points
Api pain points
Phil Sturgeon
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
Jamshid Hashimi
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 

What's hot (18)

Concept History
Concept HistoryConcept History
Concept History
 
Hebrew Bible as Data: Laboratory, Sharing, Lessons
Hebrew Bible as Data: Laboratory, Sharing, LessonsHebrew Bible as Data: Laboratory, Sharing, Lessons
Hebrew Bible as Data: Laboratory, Sharing, Lessons
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
API Pain Points (PHPNE)
API Pain Points (PHPNE)API Pain Points (PHPNE)
API Pain Points (PHPNE)
 
01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started01 ElasticSearch : Getting Started
01 ElasticSearch : Getting Started
 
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
 
JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFEJSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
 
анатолий шарифулин Mojolicious
анатолий шарифулин Mojoliciousанатолий шарифулин Mojolicious
анатолий шарифулин Mojolicious
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the Good
 
JSON-LD for RESTful services
JSON-LD for RESTful servicesJSON-LD for RESTful services
JSON-LD for RESTful services
 
E Records Resource Recommendations
E Records Resource RecommendationsE Records Resource Recommendations
E Records Resource Recommendations
 
The Web, one huge database ...
The Web, one huge database ...The Web, one huge database ...
The Web, one huge database ...
 
Api pain points
Api pain pointsApi pain points
Api pain points
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 

Viewers also liked

Service Summit M.-A. Delisle Part 2
Service Summit M.-A. Delisle Part 2Service Summit M.-A. Delisle Part 2
Service Summit M.-A. Delisle Part 2
Marie-Andrée Delisle
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
Philip Tellis
 
Boomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetupBoomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetup
Philip Tellis
 
Service Summit M.-A. Delisle Part 1
Service Summit M.-A. Delisle Part 1Service Summit M.-A. Delisle Part 1
Service Summit M.-A. Delisle Part 1
Marie-Andrée Delisle
 
Frontend Performance: Expert to Crazy Person
Frontend Performance: Expert to Crazy PersonFrontend Performance: Expert to Crazy Person
Frontend Performance: Expert to Crazy Person
Philip Tellis
 
Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)
Philip Tellis
 

Viewers also liked (6)

Service Summit M.-A. Delisle Part 2
Service Summit M.-A. Delisle Part 2Service Summit M.-A. Delisle Part 2
Service Summit M.-A. Delisle Part 2
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
Boomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetupBoomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetup
 
Service Summit M.-A. Delisle Part 1
Service Summit M.-A. Delisle Part 1Service Summit M.-A. Delisle Part 1
Service Summit M.-A. Delisle Part 1
 
Frontend Performance: Expert to Crazy Person
Frontend Performance: Expert to Crazy PersonFrontend Performance: Expert to Crazy Person
Frontend Performance: Expert to Crazy Person
 
Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)
 

More from Philip Tellis

Improving D3 Performance with CANVAS and other Hacks
Improving D3 Performance with CANVAS and other HacksImproving D3 Performance with CANVAS and other Hacks
Improving D3 Performance with CANVAS and other Hacks
Philip Tellis
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
Philip Tellis
 
Frontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou FurieuxFrontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou Furieux
Philip Tellis
 
Beyond Page Level Metrics
Beyond Page Level MetricsBeyond Page Level Metrics
Beyond Page Level Metrics
Philip Tellis
 
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
Philip Tellis
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
Philip Tellis
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
Philip Tellis
 
mmm... beacons
mmm... beaconsmmm... beacons
mmm... beacons
Philip Tellis
 
RUM Distillation 101 -- Part I
RUM Distillation 101 -- Part IRUM Distillation 101 -- Part I
RUM Distillation 101 -- Part I
Philip Tellis
 
Improving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFramesImproving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFrames
Philip Tellis
 
Extending Boomerang
Extending BoomerangExtending Boomerang
Extending Boomerang
Philip Tellis
 
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Philip Tellis
 
The Statistics of Web Performance Analysis
The Statistics of Web Performance AnalysisThe Statistics of Web Performance Analysis
The Statistics of Web Performance Analysis
Philip Tellis
 
Abusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web PerformanceAbusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web Performance
Philip Tellis
 
Rum for Breakfast
Rum for BreakfastRum for Breakfast
Rum for Breakfast
Philip Tellis
 
Analysing network characteristics with JavaScript
Analysing network characteristics with JavaScriptAnalysing network characteristics with JavaScript
Analysing network characteristics with JavaScript
Philip Tellis
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web Traffic
Philip Tellis
 
Input sanitization
Input sanitizationInput sanitization
Input sanitization
Philip Tellis
 
Messing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristicsMessing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristics
Philip Tellis
 
Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?
Philip Tellis
 

More from Philip Tellis (20)

Improving D3 Performance with CANVAS and other Hacks
Improving D3 Performance with CANVAS and other HacksImproving D3 Performance with CANVAS and other Hacks
Improving D3 Performance with CANVAS and other Hacks
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
Frontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou FurieuxFrontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou Furieux
 
Beyond Page Level Metrics
Beyond Page Level MetricsBeyond Page Level Metrics
Beyond Page Level Metrics
 
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
Frontend Performance: Beginner to Expert to Crazy Person (San Diego Web Perf ...
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
mmm... beacons
mmm... beaconsmmm... beacons
mmm... beacons
 
RUM Distillation 101 -- Part I
RUM Distillation 101 -- Part IRUM Distillation 101 -- Part I
RUM Distillation 101 -- Part I
 
Improving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFramesImproving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFrames
 
Extending Boomerang
Extending BoomerangExtending Boomerang
Extending Boomerang
 
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
 
The Statistics of Web Performance Analysis
The Statistics of Web Performance AnalysisThe Statistics of Web Performance Analysis
The Statistics of Web Performance Analysis
 
Abusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web PerformanceAbusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web Performance
 
Rum for Breakfast
Rum for BreakfastRum for Breakfast
Rum for Breakfast
 
Analysing network characteristics with JavaScript
Analysing network characteristics with JavaScriptAnalysing network characteristics with JavaScript
Analysing network characteristics with JavaScript
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web Traffic
 
Input sanitization
Input sanitizationInput sanitization
Input sanitization
 
Messing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristicsMessing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristics
 
Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?
 

Recently uploaded

Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 

Recently uploaded (20)

Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 

YQL: More than just data

  • 1. YQL: Find more than just data Philip Tellis / philip@bluesmoon.info Yahoo!7 Open Session – 11 May 2010 – #y7os Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 2. $ finger philip Philip Tellis philip@bluesmoon.info @bluesmoon yahoo geek http://bluesmoon.info/ Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 3. Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 4. missingkids.com Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 5. missingkidsmap.com http://www.missingkidsmap.com/read.php?state=CA Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 6. <locations> <maplocation zoom="5" state_long="-119.838867" state_lat="37.370157"/> <location id="1" firstname="Anastasia" lastname=" Shearer " picture="img width=160 target=_new src=http://www.missingkids.com/photographs/NCM picture2="img width=160 target=_new src=http://www.missingkids.com/photographs/NC medpic = "img width=60 border=0 target=_new src=http://www.missingkids.com/photog smallpic="img width=30 border=0 target=_new src=http://www.missingkids.com/photog policenum="1-661-861-3110" policeadd="Kern County Sheriff´ Office (California)" s policenum2="" policeadd2="" st=" CA" city="BAKERSFIELD" missing="12/26/2009" status="Endangered Runaway" age="16" url="1140669" lat="35.3733333333333" lng="-119.017777777778"/> ... </locations> Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 7. Death by 404 API call on every 404 page =⇒ Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 8. This looks like a job for... YQLCAT Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 9. SELECT SELECT * From xml Where url=’http://www.missingkidsmap.com/read.php?state=ZZ’ Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 10. Geo More useful if we find local kids Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 11. YQL can do it SELECT * From ip.location Where ip=@ip Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 12. { "query":{ ... "results":{ "Response":{ "Ip":"209.117.47.253", "Status":"OK", "CountryCode":"US", "CountryName":"United States", "RegionCode":null, "RegionName":null, "City":null, "ZipPostalCode":null, "Latitude":"38", "Longitude":"-97", "Timezone":"-6", "Gmtoffset":"-6", "Dstoffset":"-5" } Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 13. WoEID SELECT place.woeid From flickr.places Where lat=@lat And lon=@lon Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 14. WoEID SELECT place.woeid From flickr.places Where (lat, lon) IN ( SELECT Latitude, Longitude From ip.location Where ip=@ip ) Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 15. { "query":{ "count":"1", ... "results":{ "places":{ "place":{ "woeid":"12588378" } } } } } Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 16. Country/State SELECT country.code, admin1.code From geo.places Where woeid=@woeid Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 17. All together SELECT country.code, admin1.code From geo.places Where woeid IN ( SELECT place.woeid From flickr.places Where (lat, lon) IN ( SELECT Latitude, Longitude From ip.location Where ip=@ip ) ) Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 18. { "query":{ "count":"1", ... "results":{ "place":{ "country":{ "code":"US" }, "admin1":{ "code":"US-KS" } } } } } Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 19. And that’s it Throw in a bit of PHP to turn the JSON into HTML CSS to style it Wrap it in your page template eg: http://bluesmoon.info/foobar Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 20. PHP $json = http_get($missing_kids_url); $o = json_decode($json, 1); $children = $o[’query’][’results’] [’locations’][’location’]; $child = array_rand($children); print_404($child); ... header(’HTTP/1.0 404 Not Found’); Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 21. ErrorDocument 404 /404.php Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 22. Links http://tech.bluesmoon.info/2010/02/convert-ip-to-geo-info- using-yql.html http://tech.bluesmoon.info/2010/02/missing-kids-on-your- 404-page.html http://developer.yahoo.com/yql/ http://www.missingkidsmap.com/ Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 23. Photo credits http://lolcats.com/view/11439/ http://lolcats.com/view/13347/ http://www.flickr.com/photos/wwworks/440672445/ Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data
  • 24. Thank you Philip Tellis philip@bluesmoon.info @bluesmoon http://bluesmoon.info/ slideshare.net/bluesmoon Yahoo!7 Open Session – 11 May 2010 – #y7os YQL: Find more than just data