SlideShare ist ein Scribd-Unternehmen logo
1 von 145
Downloaden Sie, um offline zu lesen
Yahoo Query Language
      select * from internet



       Pedro Valente
       @pedrovalente
http://meme.yahoo.com
Hoje vou fazer o seguinte:
Hoje vou fazer o seguinte:

• Explicar o que é YQL
Hoje vou fazer o seguinte:

• Explicar o que é YQL
• Dar exemplos de como funciona
Hoje vou fazer o seguinte:

• Explicar o que é YQL
• Dar exemplos de como funciona
• Mostrar onde aprender mais
Hoje vou fazer o seguinte:

• Explicar o que é YQL
• Dar exemplos de como funciona
• Mostrar onde aprender mais
• Detalhar a tabela do Meme
De um lado, temos desenvolvedores
http://farm4.static.flickr.com/
3643/3516125392_8583644c56_b.jpg
Do outro lado, um monte de sites e serviços
Juntando desenvolvedores
com sites e serviços
Juntando desenvolvedores
com sites e serviços

surgem Mashups (aplicações)
Aplicação =
manipulação de dados
Aplicação =
manipulação de dados
Aplicação =              +
              visualização de dados
dev
dev
dev
dev
dev
dev
dev
dev
dev
dev
dev
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
var map = new YMap
          (document.getElementById('map'));
          …
dev       var currentGeoPoint = new YGeoPoint
          ( _c.Lat, _c.Lon );
          map.addMarker(currentGeoPoint);


      ?
          …



          …
          if (flickcurl_prepare(fc,


      ?
          "flickr.photos.geo.correctLocation",
          parameters, count)) { … }
          …



      ?   http://search.yahooapis.com/
          ImageSearchService/V1/imageSearch?
          appid=YahooDemo&query=Corvette&results=2


      ?
          http://weather.yahooapis.com/
          forecastrss?p=FRXX0076&u=c
var map = new YMap
          (document.getElementById('map'));
          …
dev       var currentGeoPoint = new YGeoPoint
          ( _c.Lat, _c.Lon );
          map.addMarker(currentGeoPoint);


      ?
          …



          …
          if (flickcurl_prepare(fc,


      ?
          "flickr.photos.geo.correctLocation",
          parameters, count)) { … }
          …



      ?   http://search.yahooapis.com/
          ImageSearchService/V1/imageSearch?
          appid=YahooDemo&query=Corvette&results=2


      ?
          http://weather.yahooapis.com/
          forecastrss?p=FRXX0076&u=c
Yahoo!    My Yahoo!   Mail                                                                                                          Welcome, guest       Sign In

                                                                                                                                                         Search


    MY PROJECTS           APIs & WEB SERVICES        var map = new YMap
                                                       RESOURCES          SUPPORT

YDN          Maps Suite     AJAX Maps                (document.getElementById('map'));
Yahoo! Maps Web Services - AJAX API Getting          …                                                            READY TO GET STARTED?
                                                                                                                                                                  You aren't signed in      Sign In   Help

Started Guide                                                                 Get an App ID
                                                     var currentGeoPoint = new YGeoPoint
           dev Home     The Tour     Sign Up     Explore                                    Search
Learn the fundamentals of the Yahoo! Maps AJAX API and start creating your own maps. This page contains:

Introduction and Prerequisites
                                                     ( _c.Lat, _c.Lon );   Yahoo! Maps Cheatsheets
Examples       Flickr Services                                                      Yahoo!    My Yahoo!  Mail  RECENT BLOG ARTICLES                                                                                                  Welcome, guest            Sign In

               API Documentation Feeds Your API Keys map.addMarker(currentGeoPoint);
      Display a Yahoo! Map




                                                                 ?
                                                      Apply for a new API Key
      Add controls to your Yahoo! Map                                                                          Leonardo da Vinci: Hacker                                                                                                               Search
      Add a logger to a Yahoo! Map
      Place a marker on a Yahoo! Map                 …                             MY PROJECTS
                                                                                                               January 24, 2009

                                                                                                        APIs & WEB SERVICES             RESOURCES            SUPPORT
      Draw Polylines on a Yahoo! Map                                                                           Whaddyathink? & the Yahoo! Application
      Place Smart Markers on a Yahoo! Map
                                         flickr.places.getPlaceTypes
      Add multiple custom markers on Yahoo! Map
                                                                                  YDN       Weather RSS Feed
                                                                                                               Platform
                                                                                                               January 22, 2009
      Traffic information overlay
      Yahoo! Pipes RSS output information overlay             Yahoo! Weather RSS Feed                          Making the new Yahoo! Currency Converter
                                                                                                                                    Yahoo!    My Yahoo!   Mail                                                                                                                                 Welcome, guest             Sign In
      Local search results overlay
                                           Fetches a list of available place types for Flickr.
      Yahoo! Pipes JSON output information overlay
                                                                           YMap                                accessible
                                                                                  The Weather RSS feed enables you
                                                                                                               Januaryto get up-to-date weather information for your location. You can save this
                                                                                                                        21, 2009
      Overlay GeoRSS XML data
      Overlay custom objects at YGeoPoint location
                                                                                         …
                                                                                  feed in My Yahoo! or your favorite feed aggregator, or incorporate the RSS data into your own web site or client
                                                                                                                                                                                                                                                                                                                    Search

                                                                                  application. The Weather RSSRetrievingdynamically-generatedfrom based on zip code or Location ID.
                                                                                                                feed is a and displaying data feed
                                         Authentication
      Overlay custom objects at YCoordPoint location
      Overlay polyline on Yahoo! Map                                                     if (flickcurl_prepare(fc,
                                                                                                               Wikipedia with YQL PROJECTS
                                                                                                                                   MY                    APIs & WEB SERVICES             RESOURCES
                                                                                  This page describes the format of the 18, 2009 URL and the RSS response for developers. It contains these
                                                                                                               January request
                                                                                                                                                                                                          SUPPORT




                                                                 ?
      Export Yahoo! Map in GeoRSS format                                                                                           YDN       Image Search Documentation for Yahoo! Search Web Services
                                        This method does not require authentication.
      GeoRSS overlay with polyline
                                                                                         "flickr.photos.geo.correctLocation",
                                                                                  sections:
      Get zoom level given radius from center
      Custom position of controls        Arguments                                     RSS Request    Image Search Documentation for Yahoo! Search                                                                                                                  READY TO GET STARTED?

      Change Marker Images Dynamically
      Use YMapTypeControl to position map types
                                                                                         parameters, count)) { … }
                                                                                            Summary
                                                                                            Request Parameters
                                                                                                                                                                                                                                                                    By applying for an Application ID for this service, you
                                                                                                                                                                                                                                                                    hereby agree to the Terms of Use

                                                                                                      Submitting Image Queries
Rate Limit
                                        api_key (Required)
Other Features of the Yahoo! Maps AJAX API
                                                                                         …
                                                                                       RSS Response
                                                                           YEvent, YGeoRSS, YMarker
                                               Your API application key. See here for moreTop-Level Elements
                                                                                              details.                             The Image Search Web Service allows you to search the Internet for images.
                                                                                                                                                                                                                                                                                       Get an App ID
Terms of Service                                                                            Channel Elements
Support & Community
                                                                                            Image Elements
                                         Example Response



                                                                 ?
                                                                                            Item Elements
Download all of the cheatsheets and example code in the Yahoo                                                                        Request URL
Maps API Reference Bundle.                                                                  Condition Codes                                                                                                                                                         YAHOO! GROUPS DISCUSSIONS                           view all
                                         <place_types>                                 Examples                                    http://search.yahooapis.com/ImageSearchService/V1/imageSearch
For detailed descriptions of the classes and methods in the API, place_type_id="22">neighbourhood</place_type>
                                              <place_type                                                                                                                                                                                                           yahoo local search code in php
                                                                                       Terms of Use
                                                                                                                                                                                                                                                                    Tue, 27 Jan 2009
check out v3.8 Reference Manual.              <place_type place_type_id="7">locality</place_type>
                                             <place_type
                                             <place_type
                                                                                        http://search.yahooapis.com/
                                                                 place_type_id="9">county</place_type>
                                                                                RSS Request
                                                                 place_type_id="8">region</place_type>
                                                                         Remaining, Supporting Classes
                                                                                                                             Request parameters                                                                                                                     My Web Search API shut down
                                                                                                                             See information on constructing REST queries                                                                                           announcement

Introduction and
                                             <place_type
                                 Prerequisites
                                             <place_type
                                                                                        ImageSearchService/V1/imageSearch?
                                                                 place_type_id="12">country</place_type>
                                                                                The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add
                                                                 place_type_id="29">continent</place_type> (?). Multiple parameters are separated by an ampersand (&).
                                                                                parameters and values after a question mark
                                                                                                                                                                                                                                                                    Wed, 21 Jan 2009
                                                                                                                                       Parameter     Value                  Description
                                         </place_types>
                                                                                        appid=YahooDemo&query=Corvette&results=2
The Yahoo! AJAX Maps API lets developers add maps to their web sites using DHTML and JavaScript®. the Weather RSS feed is
                                                                                       The base URL for Maps
                                                                                                                                      appid        string (required)      The application ID. See Application IDs for more information.
                                                                                                                                                                                                                                                                    Re: Site Explorer API returns 999 Rate Limit
                                                                                                                                                                                                                                                                    Exceeded
are fully embeddable and scriptable using the JavaScript programming language. Yahoo! Maps AS-Flash API's                             query        string (required)      The query to search for. Use + to include terms, - to exclude terms, and                  Wed, 21 Jan 2009




                                                                 ?
                                         Error Codes
built-in geocoder means that you can specify a physical address or latitude/longitude coordinates for your map's
                                                                                       http://weather.yahooapis.com/forecastrss                                           put quotes around "exact phrase".
location, as you like.                                                                                                                type         all (default), any, or The kind of search to submit:                                                             Reminder: Old obsolete versions of Local
                                                                                       In this section, Summary shows how to make an RSS request with different parameters; Request Parameters
                                                                                                                                                   phrase                                                                                                           Search (V1, V2) shutting do
In order to create and test applications 100: Yahoo! Maps AJAX API, you'll need to use a supported summarizing those parameters.
                                         using Invalid API Key                         shows a table web                                                                  all returns results with all query terms.                                                 Mon, 19 Jan 2009
                                                The API key passed was not valid or has expired.
browser: Firefox 2, Internet Explorer 6 or 7, Opera 9 or Safari 3. Newer versions of these browsers are also                                                              any returns results with one or more of the query terms.
supported. You can code your JavaScript applications usingcurrently unavailable
                                         105: Service your favorite text editor or IDE.                                                                                   phrase returns results containing the query terms as a phrase.
                                                                                       SUMMARY                                        results      integer: default 10, The number of results to return.
                                                The requested service is temporarily unavailable.
An application ID is required to use the Yahoo! Maps AJAX API. You can get an application ID here.                                                 max 50
                                                                                       The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add
                                         111: Format "xxx" not found
                                                                                                                                       start         integer: default 1
                                                                                      parameters and values after a question mark (?). Multiple parameters are separated   by an starting result position to return (1-based). The finishing position (start
                                                                                                                                                                            The ampersand (&). For
For best results, you should launch your web pagesrequested response format was not found. applications
                                                The from a web server. However, it's possible to run                                                                        + results - 1) cannot exceed 1000.
                                                                                      the Weather RSS feed there are two parameters:
directly from your hard drive by double-clickingMethod This can be donefound
                                       112: on them. "xxx" not by lowering the security settings in                                    format        any (default), bmp,    Specifies the kind of image file to search for.
the Internet Explorer browser or by setting the The requested method was not found. p for location.
                                                UniversalBrowserRead property in Firefox.                                                            gif, jpeg, png
                                                                                          u for degrees units (Fahrenheit or Celsius). adult_ok
                                       114: Invalid SOAP envelope
                                                                                  http://weather.yahooapis.com/                                      no value or 1
                                                                                                                                                                   content.
                                                                                                                                                                            The service filters out adult content by default. Enter a 1 to allow adult
                                           The SOAP envelope send in the requestlocationnot be parsed. required. Use this parameter to indicate the location for the weather forecast as a
                                                                            The could parameter p is
Displaying a Yahoo!                 Map                                     zip code or Location ID.                         coloration     any (default), color, The service returns only the images of the coloration specified (color or
                                      115: Invalid XML-RPC Method Call
                                                                                  forecastrss?p=FRXX0076&u=c
All the API classes and methods necessary to interact with Yahoo! Maps are available to your application when
                                                The XML-RPC request document could not be parsed.
                                                                                    http://weather.yahooapis.com/forecastrss?p=location
                                                                                                                                          bw                                black-and-white).
                                                                                                                            site          string: default no                A domain to restrict your searches to (e.g. www.yahoo.com). You may
you include Yahoo! Maps AJAX API library in your web page.This example uses the demonstration application
                                                                                                                                          value                             submit up to 30 values (site=www.yahoo.com&site=www.cnn.com).
ID "YD-eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1H"; you cannot use this Application Forand must requestweather for Yahoo! Headquarters in Sunnyvale, CA, use the zip
                                                                                    ID example, to get one                                                                 code for Sunnyvale
here.                                    API Explorer                               (94089):
                                                                                                                            output        string: xml                       The format for the output. If json is requested, the results will be returned
                                                                                                                                          (default), json, php              in JSON format. If php is requested, the results will be returned in
                                                                                                                                                                            Serialized PHP format.
.    <html>                     API Explorer : flickr.places.getPlaceTypes
                                                                      http://weather.yahooapis.com/forecastrss?p=94089
.    <head>                                                                                                         callback string                                         The name of the callback function to wrap around the JSON data. The
.    <b><script type="text/javascript"                                Or use the Location ID for Sunnyvale (USCA1116):                                                      following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has
.    src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=YD-                                                                                                                not been requested, this parameter has no effect. More information on the
var map = new YMap
      (document.getElementById('map'));
      …
dev   var currentGeoPoint = new YGeoPoint
      ( _c.Lat, _c.Lon );
      map.addMarker(currentGeoPoint);
      …



      …
      if (flickcurl_prepare(fc,
      "flickr.photos.geo.correctLocation",
      parameters, count)) { … }
      …



      http://search.yahooapis.com/
      ImageSearchService/V1/imageSearch?
      appid=YahooDemo&query=Corvette&results=2




      http://weather.yahooapis.com/
      forecastrss?p=FRXX0076&u=c
dev




      YQL
dev




      YQL
dev



       Bindings




      YQL
dev



       Bindings




      YQL
dev



                  Bindings




      YQL stmt
                 YQL
dev



                  Bindings




      YQL stmt
                 YQL
      select
dev



                  Bindings




      YQL stmt
                 YQL
      select
      desc
dev



                  Bindings




      YQL stmt
                 YQL
      select
      desc
      show
select {what} from
{service} where
{condition}
select {what} from
         {service} where
         {condition}
show tables
desc table

         select {what} from
         {service} where
         {condition}
show tables
desc table

         select {what} from
         {service} where
         {condition}
show tables         filtros
                    remotos e
                    locais
A ferramenta

http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
http://developer.yahoo.com/yql/console
• "Community Tables" são apenas
  arquivos XML
• "Community Tables" são apenas
  arquivos XML

• Qualquer um pode fazer
• "Community Tables" são apenas
  arquivos XML

• Qualquer um pode fazer
• Manda lá pro Github
  http://www.datatables.org/
  http://github.com/yql/yql-tables
FIGHT!
Começamos com um usuário do Meme
 http://meme.yahoo.com/caiocardoso
SELECT * FROM meme.info WHERE
name='caiocardoso'
SELECT * FROM meme.info WHERE
 name='caiocardoso'
"results":{
   "meme":{
    "guid":"66VIWI4DGQ44QE2VHU5EAT545E",
    "name":"tommarques",
    "title":"Tom Marques",
    "description":null,
    "url":"http://meme.yahoo.com/tommarques/",
    "avatar_url":"http://d.yimg.com/gg/tommarques/
avatars/
9bc435ebdc410b85f2971aba0800f806610d49ca.jpeg",
    "language":"pt",
    "followers":"131"
   }
  }
Não esqueça!
 Você pode testar todas as queries
 mostradas aqui no console do YQL


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

  http://bit.ly/memeconsole
SELECT * FROM meme.info WHERE
 name='caiocardoso'

"results":{
   "meme":{
    "guid":"YZWI5S26GHSGODZHAXIQFQIQVU",
    "name":"caiocardoso",
    "title":"Caiocardoso",
    "description":"Freelancer! conheça e contrate:
www.caiocardoso.com =D",
    "url":"http://meme.yahoo.com/caiocardoso/",
    "avatar_url":"http://d.yimg.com/gg/caiocardoso/
avatars/bcc90c4338a59f963db4c101ee9c84edb2abfc42.jpeg",
    "language":"pt",
    "followers":"178"
   }
SELECT guid FROM meme.info WHERE
name='caiocardoso'
SELECT * FROM meme.posts WHERE
owner_guid in (
   SELECT guid FROM meme.info WHERE
   name='caiocardoso'
);
SELECT * FROM meme.posts WHERE
owner_guid in (
   SELECT guid FROM meme.info WHERE
   name='caiocardoso'
);
"post":[{
     "pubid":"FSnvlto",
     "guid":"YZWI5S26GHSGODZHAXIQFQIQVU",
     "url":"http://meme.yahoo.com/caiocardoso/p/FSnvlto/",
     "timestamp":"1264110678257",
     "category":"photo",
     "type":"photo",
     "content":"http://d.yimg.com/gg/u/
ff25e03db0dcfbb1b6b4a9d4691d697b701dab48.jpeg",
     "repost_count":"82",
     "caption":"<b>Pac Man Ghosts</b>",
...
Um post dele
http://meme.yahoo.com/caiocardoso/p/Bza-m_n/
SELECT * FROM meme.post.info WHERE pubid='Bza-m_n'
AND owner_guid in (
     SELECT guid FROM meme.info WHERE name='caiocardoso'
);
SELECT * FROM meme.post.info(1000)

WHERE pubid='Bza-m_n' AND owner_guid in (

   SELECT guid FROM meme.info WHERE name='caiocardoso'

) AND comment != '';
SELECT * FROM meme.post.info(1000)

WHERE pubid='Bza-m_n' AND owner_guid in (

    SELECT guid FROM meme.info WHERE name='caiocardoso'

) AND comment != '';



{
     "type":"comment",
     "appid":null,
     "guid":"AJX2LREON4SKPCFPUV77N3C6VE",
     "pubid":"l2a-MOA",
     "origin":"YZWI5S26GHSGODZHAXIQFQIQVU",
     "origin_pubid":"Bza-m_n",
     "via":"AJX2LREON4SKPCFPUV77N3C6VE",
     "timestamp":"1268336540",
     "comment":"BahÊa"
    },
Olha o que aconteceu nos bastidores:
<diagnostics>
        <publiclyCallable>true</publiclyCallable>

        <url execution-time="33"><![CDATA[http://meme/api/v1/public/info/?
name=caiocardoso]]></url>

        <url execution-time="563"><![CDATA[http://meme/api/v1/public/permalink/
info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=1&count=100]]></url>

        <url execution-time="631"><![CDATA[http://meme/api/v1/public/permalink/
info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=2&count=100]]></url>

        <url execution-time="611"><![CDATA[http://meme/api/v1/public/permalink/
info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=3&count=100]]></url>

        <url execution-time="643"><![CDATA[http://meme/api/v1/public/permalink/
info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=4&count=100]]></url>

        <url execution-time="936"><![CDATA[http://meme/api/v1/public/permalink/
info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=5&count=100]]></url>

        <user-time>3427</user-time>
        <service-time>3417</service-time>
        <build-version>5275</build-version>
    </diagnostics>
Conseguimos uma lista de lugares...
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"

"comment":"Pindamonhangaba e sim, a cidade existe."
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"

"comment":"Pindamonhangaba e sim, a cidade existe."

"comment":"putiz sou de cotia sp"
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"

"comment":"Pindamonhangaba e sim, a cidade existe."

"comment":"putiz sou de cotia sp"

"comment":"Salvador...Baeeaaaaaaaaa"
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"

"comment":"Pindamonhangaba e sim, a cidade existe."

"comment":"putiz sou de cotia sp"

"comment":"Salvador...Baeeaaaaaaaaa"

"comment":"Boa noite memers, ah sou de Belém do Pará"
Conseguimos uma lista de lugares...
"comment":"ops, moro em Goias, mas sou do RJ"

"comment":"Pindamonhangaba e sim, a cidade existe."

"comment":"putiz sou de cotia sp"

"comment":"Salvador...Baeeaaaaaaaaa"

"comment":"Boa noite memers, ah sou de Belém do Pará"



 ... mas em linguagem beeem natural :(
SELECT * FROM geo.places WHERE
text = "o Rio de Janeiro continua lindo"
SELECT * FROM geo.places WHERE
text = "o Rio de Janeiro continua lindo"

 "place":{
     "lang":"en-US",
     "uri":"http://where.yahooapis.com/v1/place/
 455825",
     "woeid":"455825",
     "placeTypeName":{
      "code":"7",
      "content":"Town"
     },
     "name":"Rio de Janeiro",
     "country":{
      "code":"BR",
      "type":"Country",
      "content":"Brazil"
     },
 ...
SELECT * FROM geo.places WHERE
text = "o Rio de Janeiro continua lindo"
SELECT * FROM geo.places WHERE
text = "o Rio de Janeiro continua lindo"
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

       SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

       SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

       SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
Legal, conseguimos uma lista de woeids...
Legal, conseguimos uma lista de woeids...
  {
  "woeid":"2344849",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"4"    }
    },
    {
      "woeid":"455847",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"1"
      }
    },
    {
      "woeid":"2344856",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"19"
      }
Legal, conseguimos uma lista de woeids...

                         | unique(field='woeid')
Legal, conseguimos uma lista de woeids...
  {
  "woeid":"2344849",
      "yahoo:repeatcount":{   | unique(field='woeid')
        "field":"woeid",
        "content":"4"    }
    },
    {
      "woeid":"455847",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"1"
      }
    },
    {
      "woeid":"2344856",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"19"
      }
E podemos ordená-la se estivermos a fim

SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

       SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
  | sort(field="yahoo:repeatcount", descending="true")
Blz, woeids ordenados por
quantidade de ocorrências
Blz, woeids ordenados por
         quantidade de ocorrências
{
      "woeid":"455827",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"29"
      }
    },
    {
      "woeid":"20105181",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"27"
      }
    },
    {
      "woeid":"748328",
      "yahoo:repeatcount":{
        "field":"woeid",
        "content":"26"
      }
Estamos quase lá
Estamos quase lá
Estamos quase lá




mas precisamos de uma ajuda...
DESC flickr.photos.search
DESC flickr.photos.search

 <key   name="machine_tags" type="xs:string"/>
 <key   name="safe_search" type="xs:string"/>
 <key   name="privacy_filter" type="xs:string"/>
 <key   name="contacts" type="xs:string"/>
 <key   name="tag_mode" type="xs:string"/>
 <key   name="user_id" type="xs:string"/>
 <key   name="license" type="xs:string"/>
 <key   name="geo_context" type="xs:string"/>
 <key   name="lat" type="xs:string"/>
 <key   name="tags" type="xs:string"/>
 <key   name="lon" type="xs:string"/>
 <key   name="text" type="xs:string"/>
 <key   name="max_taken_date" type="xs:string"/>
 <key   name="is_commons" type="xs:string"/>
 <key   name="radius" type="xs:string"/>
 <key   name="woe_id" type="xs:string"/>
 <key   name="has_geo" type="xs:string"/>
SELECT * FROM flickr.photos.search
WHERE text='brhackday'
SELECT * FROM flickr.photos.search
WHERE text='brhackday'



SELECT * FROM flickr.photos.search
WHERE is_commons='true'
SELECT * FROM flickr.photos.search
WHERE text='brhackday'



SELECT * FROM flickr.photos.search
WHERE is_commons='true'



SELECT * FROM flickr.photos.search
WHERE user_id='foobar'
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

        SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
  | sort(field="yahoo:repeatcount", descending="true")
SELECT * FROM flickr.photos.search(5)
WHERE has_geo="true" and woe_id in (

    SELECT woeid FROM geo.places WHERE text in (
       SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

       AND owner_guid in (

            SELECT guid FROM meme.info WHERE name='caiocardoso'

       ) AND comment != '';
    ) | unique(field='woeid')
      | sort(field="yahoo:repeatcount", descending="true")

)
SELECT * FROM flickr.photos.search(5)
WHERE has_geo="true" and woe_id in (

    SELECT woeid FROM geo.places WHERE text in (
          SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

          AND owner_guid in (

              SELECT guid FROM meme.info WHERE name='caiocardoso'

          ) AND comment != '';
    ) | unique(field='woeid')
      | sort(field="yahoo:repeatcount", descending="true")

)
    <results>
            <photo farm="3" id="4125642160" isfamily="0" isfriend="0" ispublic="1"
    owner="21381694@N07" secret="af0b6091b2" server="2629" title="Numa noite
    dessas, por ai..."/>
            <photo farm="3" id="4122278478" isfamily="0" isfriend="0" ispublic="1"
    owner="11264537@N05" secret="34f6ce4517" server="2660" title="AST Facilities
    02"/>
            <photo farm="3" id="4055857251" isfamily="0" isfriend="0" ispublic="1"
    owner="44116004@N03" secret="5115fe3d9d" server="2538" title="Negao e Vinny"/>

    ...
E o resultado...
SELECT woeid, centroid.latitude, centroid.longitude
FROM geo.places WHERE text in (

   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

        SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';

) | unique(field='woeid')
  | sort(field="yahoo:repeatcount", descending="true")
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

        SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
  | sort(field="yahoo:repeatcount", descending="true")
SELECT woeid FROM geo.places WHERE text in (
   SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

   AND owner_guid in (

        SELECT guid FROM meme.info WHERE name='caiocardoso'

   ) AND comment != '';
) | unique(field='woeid')
  | sort(field="yahoo:repeatcount", descending="true")




                   Em uma query,
             3 sites/serviços diferentes,
                   3 APIs distintas
SELECT * FROM flickr.photos.search(5)
WHERE has_geo="true" and woe_id in (

    SELECT woeid FROM geo.places WHERE text in (
       SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n'

       AND owner_guid in (

            SELECT guid FROM meme.info WHERE name='caiocardoso'

       ) AND comment != '';
    ) | unique(field='woeid')
      | sort(field="yahoo:repeatcount", descending="true")

)


                       Em uma query,
                 3 sites/serviços diferentes,
                       3 APIs distintas
É mágico e revolucionário!
É mágico e revolucionário!
Tem muito mais!
INSERT

UPDATE

DELETE
USE
use ‘http://meusite.com.br/minhatabela.xml’
as hackMasterPlus;

select * from hackMasterPlus where ...
Fork me!
http://github.com/yql/yql-tables
http://datatables.org
EXECUTE
STORE
(SHERPA)
Mão na massa:
http://developer.yahoo.com/yql/guide/yql-code-examples.html
este é o YQL
pra construir aplicações
  de forma mais fácil
pra construir aplicações
      mais rápidas
      mais rápido
serviço no cloud faz o trabalho

processamento, filtros, conversões

menos chamadas de serviços

infraestrutura confiável
quer saber mais?
http://developer.yahoo.com/yql/

http://developer.yahoo.com/meme/
Yahoo Query Language
      select * from internet



       Pedro Valente
       @pedrovalente

Weitere ähnliche Inhalte

Ähnlich wie “SELECT * FROM internet;” como usar o YQL com Yahoo! Meme e outros serviços

YQL - select * from internet version 2
YQL - select * from internet version 2YQL - select * from internet version 2
YQL - select * from internet version 2Tom Croucher
 
Yql Openhackday 2009
Yql Openhackday 2009Yql Openhackday 2009
Yql Openhackday 2009nageshs
 
YQL - A Query Language for the Web
YQL - A Query Language for the WebYQL - A Query Language for the Web
YQL - A Query Language for the WebTom Croucher
 
Mobile Data: How to avoid the latency trap - SWDC 2010
Mobile Data: How to avoid the latency trap - SWDC 2010Mobile Data: How to avoid the latency trap - SWDC 2010
Mobile Data: How to avoid the latency trap - SWDC 2010Tom Croucher
 
YQL and YUI - Javascript from server to user
YQL and YUI - Javascript from server to userYQL and YUI - Javascript from server to user
YQL and YUI - Javascript from server to userTom Croucher
 
How to avoid the latency trap and lessons about software design
How to avoid the latency trap and lessons  about software designHow to avoid the latency trap and lessons  about software design
How to avoid the latency trap and lessons about software designTom Croucher
 
GeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectGeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectKentaro Ishimaru
 
Sirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformSirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformObeo
 
Find your way with SAPO Maps API
Find your way with SAPO Maps APIFind your way with SAPO Maps API
Find your way with SAPO Maps APIjdduarte
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data APIss318
 
Google MAP API
Google MAP APIGoogle MAP API
Google MAP APIEric Lee
 
Yahoo! features
Yahoo! featuresYahoo! features
Yahoo! featuresNaga14
 
Mashups in the Information Technology Classroom
Mashups in the Information Technology ClassroomMashups in the Information Technology Classroom
Mashups in the Information Technology ClassroomMark Frydenberg
 
Mapping For Sharepoint T11 Peter Smith
Mapping For Sharepoint T11 Peter SmithMapping For Sharepoint T11 Peter Smith
Mapping For Sharepoint T11 Peter SmithSpatialSmith
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Programming For Google Wave
Programming For Google WaveProgramming For Google Wave
Programming For Google WaveRodrigo Borges
 

Ähnlich wie “SELECT * FROM internet;” como usar o YQL com Yahoo! Meme e outros serviços (20)

YQL - select * from internet version 2
YQL - select * from internet version 2YQL - select * from internet version 2
YQL - select * from internet version 2
 
Yql Openhackday 2009
Yql Openhackday 2009Yql Openhackday 2009
Yql Openhackday 2009
 
YQL - A Query Language for the Web
YQL - A Query Language for the WebYQL - A Query Language for the Web
YQL - A Query Language for the Web
 
Mobile Data: How to avoid the latency trap - SWDC 2010
Mobile Data: How to avoid the latency trap - SWDC 2010Mobile Data: How to avoid the latency trap - SWDC 2010
Mobile Data: How to avoid the latency trap - SWDC 2010
 
YQL and YUI - Javascript from server to user
YQL and YUI - Javascript from server to userYQL and YUI - Javascript from server to user
YQL and YUI - Javascript from server to user
 
YQL Tutorial
YQL TutorialYQL Tutorial
YQL Tutorial
 
Seti 09
Seti 09Seti 09
Seti 09
 
How to avoid the latency trap and lessons about software design
How to avoid the latency trap and lessons  about software designHow to avoid the latency trap and lessons  about software design
How to avoid the latency trap and lessons about software design
 
GeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectGeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri Project
 
Sirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformSirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the Platform
 
Google Maps Api
Google Maps ApiGoogle Maps Api
Google Maps Api
 
Find your way with SAPO Maps API
Find your way with SAPO Maps APIFind your way with SAPO Maps API
Find your way with SAPO Maps API
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data API
 
Google MAP API
Google MAP APIGoogle MAP API
Google MAP API
 
Yahoo! features
Yahoo! featuresYahoo! features
Yahoo! features
 
Mashups in the Information Technology Classroom
Mashups in the Information Technology ClassroomMashups in the Information Technology Classroom
Mashups in the Information Technology Classroom
 
Yandex Maps API
Yandex Maps APIYandex Maps API
Yandex Maps API
 
Mapping For Sharepoint T11 Peter Smith
Mapping For Sharepoint T11 Peter SmithMapping For Sharepoint T11 Peter Smith
Mapping For Sharepoint T11 Peter Smith
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Programming For Google Wave
Programming For Google WaveProgramming For Google Wave
Programming For Google Wave
 

Kürzlich hochgeladen

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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
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 convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

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...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
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 convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

“SELECT * FROM internet;” como usar o YQL com Yahoo! Meme e outros serviços

  • 1. Yahoo Query Language select * from internet Pedro Valente @pedrovalente
  • 2.
  • 4. Hoje vou fazer o seguinte:
  • 5. Hoje vou fazer o seguinte: • Explicar o que é YQL
  • 6. Hoje vou fazer o seguinte: • Explicar o que é YQL • Dar exemplos de como funciona
  • 7. Hoje vou fazer o seguinte: • Explicar o que é YQL • Dar exemplos de como funciona • Mostrar onde aprender mais
  • 8. Hoje vou fazer o seguinte: • Explicar o que é YQL • Dar exemplos de como funciona • Mostrar onde aprender mais • Detalhar a tabela do Meme
  • 9. De um lado, temos desenvolvedores
  • 10.
  • 12. Do outro lado, um monte de sites e serviços
  • 13.
  • 14.
  • 15.
  • 17. Juntando desenvolvedores com sites e serviços surgem Mashups (aplicações)
  • 18.
  • 21. manipulação de dados Aplicação = + visualização de dados
  • 22.
  • 23. dev
  • 24. dev
  • 25. dev
  • 26. dev
  • 27. dev
  • 28. dev
  • 29. dev
  • 30. dev
  • 31. dev
  • 32. dev
  • 33. dev
  • 34. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); …
  • 35. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } …
  • 36. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2
  • 37. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 38. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 39. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 40. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 41. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 42. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); ? … … if (flickcurl_prepare(fc, ? "flickr.photos.geo.correctLocation", parameters, count)) { … } … ? http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 ? http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 43. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); ? … … if (flickcurl_prepare(fc, ? "flickr.photos.geo.correctLocation", parameters, count)) { … } … ? http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 ? http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 44. Yahoo! My Yahoo! Mail Welcome, guest Sign In Search MY PROJECTS APIs & WEB SERVICES var map = new YMap RESOURCES SUPPORT YDN Maps Suite AJAX Maps (document.getElementById('map')); Yahoo! Maps Web Services - AJAX API Getting … READY TO GET STARTED? You aren't signed in Sign In Help Started Guide Get an App ID var currentGeoPoint = new YGeoPoint dev Home The Tour Sign Up Explore Search Learn the fundamentals of the Yahoo! Maps AJAX API and start creating your own maps. This page contains: Introduction and Prerequisites ( _c.Lat, _c.Lon ); Yahoo! Maps Cheatsheets Examples Flickr Services Yahoo! My Yahoo! Mail RECENT BLOG ARTICLES Welcome, guest Sign In API Documentation Feeds Your API Keys map.addMarker(currentGeoPoint); Display a Yahoo! Map ? Apply for a new API Key Add controls to your Yahoo! Map Leonardo da Vinci: Hacker Search Add a logger to a Yahoo! Map Place a marker on a Yahoo! Map … MY PROJECTS January 24, 2009 APIs & WEB SERVICES RESOURCES SUPPORT Draw Polylines on a Yahoo! Map Whaddyathink? & the Yahoo! Application Place Smart Markers on a Yahoo! Map flickr.places.getPlaceTypes Add multiple custom markers on Yahoo! Map YDN Weather RSS Feed Platform January 22, 2009 Traffic information overlay Yahoo! Pipes RSS output information overlay Yahoo! Weather RSS Feed Making the new Yahoo! Currency Converter Yahoo! My Yahoo! Mail Welcome, guest Sign In Local search results overlay Fetches a list of available place types for Flickr. Yahoo! Pipes JSON output information overlay YMap accessible The Weather RSS feed enables you Januaryto get up-to-date weather information for your location. You can save this 21, 2009 Overlay GeoRSS XML data Overlay custom objects at YGeoPoint location … feed in My Yahoo! or your favorite feed aggregator, or incorporate the RSS data into your own web site or client Search application. The Weather RSSRetrievingdynamically-generatedfrom based on zip code or Location ID. feed is a and displaying data feed Authentication Overlay custom objects at YCoordPoint location Overlay polyline on Yahoo! Map if (flickcurl_prepare(fc, Wikipedia with YQL PROJECTS MY APIs & WEB SERVICES RESOURCES This page describes the format of the 18, 2009 URL and the RSS response for developers. It contains these January request SUPPORT ? Export Yahoo! Map in GeoRSS format YDN Image Search Documentation for Yahoo! Search Web Services This method does not require authentication. GeoRSS overlay with polyline "flickr.photos.geo.correctLocation", sections: Get zoom level given radius from center Custom position of controls Arguments RSS Request Image Search Documentation for Yahoo! Search READY TO GET STARTED? Change Marker Images Dynamically Use YMapTypeControl to position map types parameters, count)) { … } Summary Request Parameters By applying for an Application ID for this service, you hereby agree to the Terms of Use Submitting Image Queries Rate Limit api_key (Required) Other Features of the Yahoo! Maps AJAX API … RSS Response YEvent, YGeoRSS, YMarker Your API application key. See here for moreTop-Level Elements details. The Image Search Web Service allows you to search the Internet for images. Get an App ID Terms of Service Channel Elements Support & Community Image Elements Example Response ? Item Elements Download all of the cheatsheets and example code in the Yahoo Request URL Maps API Reference Bundle. Condition Codes YAHOO! GROUPS DISCUSSIONS view all <place_types> Examples http://search.yahooapis.com/ImageSearchService/V1/imageSearch For detailed descriptions of the classes and methods in the API, place_type_id="22">neighbourhood</place_type> <place_type yahoo local search code in php Terms of Use Tue, 27 Jan 2009 check out v3.8 Reference Manual. <place_type place_type_id="7">locality</place_type> <place_type <place_type http://search.yahooapis.com/ place_type_id="9">county</place_type> RSS Request place_type_id="8">region</place_type> Remaining, Supporting Classes Request parameters My Web Search API shut down See information on constructing REST queries announcement Introduction and <place_type Prerequisites <place_type ImageSearchService/V1/imageSearch? place_type_id="12">country</place_type> The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add place_type_id="29">continent</place_type> (?). Multiple parameters are separated by an ampersand (&). parameters and values after a question mark Wed, 21 Jan 2009 Parameter Value Description </place_types> appid=YahooDemo&query=Corvette&results=2 The Yahoo! AJAX Maps API lets developers add maps to their web sites using DHTML and JavaScript®. the Weather RSS feed is The base URL for Maps appid string (required) The application ID. See Application IDs for more information. Re: Site Explorer API returns 999 Rate Limit Exceeded are fully embeddable and scriptable using the JavaScript programming language. Yahoo! Maps AS-Flash API's query string (required) The query to search for. Use + to include terms, - to exclude terms, and Wed, 21 Jan 2009 ? Error Codes built-in geocoder means that you can specify a physical address or latitude/longitude coordinates for your map's http://weather.yahooapis.com/forecastrss put quotes around "exact phrase". location, as you like. type all (default), any, or The kind of search to submit: Reminder: Old obsolete versions of Local In this section, Summary shows how to make an RSS request with different parameters; Request Parameters phrase Search (V1, V2) shutting do In order to create and test applications 100: Yahoo! Maps AJAX API, you'll need to use a supported summarizing those parameters. using Invalid API Key shows a table web all returns results with all query terms. Mon, 19 Jan 2009 The API key passed was not valid or has expired. browser: Firefox 2, Internet Explorer 6 or 7, Opera 9 or Safari 3. Newer versions of these browsers are also any returns results with one or more of the query terms. supported. You can code your JavaScript applications usingcurrently unavailable 105: Service your favorite text editor or IDE. phrase returns results containing the query terms as a phrase. SUMMARY results integer: default 10, The number of results to return. The requested service is temporarily unavailable. An application ID is required to use the Yahoo! Maps AJAX API. You can get an application ID here. max 50 The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add 111: Format "xxx" not found start integer: default 1 parameters and values after a question mark (?). Multiple parameters are separated by an starting result position to return (1-based). The finishing position (start The ampersand (&). For For best results, you should launch your web pagesrequested response format was not found. applications The from a web server. However, it's possible to run + results - 1) cannot exceed 1000. the Weather RSS feed there are two parameters: directly from your hard drive by double-clickingMethod This can be donefound 112: on them. "xxx" not by lowering the security settings in format any (default), bmp, Specifies the kind of image file to search for. the Internet Explorer browser or by setting the The requested method was not found. p for location. UniversalBrowserRead property in Firefox. gif, jpeg, png u for degrees units (Fahrenheit or Celsius). adult_ok 114: Invalid SOAP envelope http://weather.yahooapis.com/ no value or 1 content. The service filters out adult content by default. Enter a 1 to allow adult The SOAP envelope send in the requestlocationnot be parsed. required. Use this parameter to indicate the location for the weather forecast as a The could parameter p is Displaying a Yahoo! Map zip code or Location ID. coloration any (default), color, The service returns only the images of the coloration specified (color or 115: Invalid XML-RPC Method Call forecastrss?p=FRXX0076&u=c All the API classes and methods necessary to interact with Yahoo! Maps are available to your application when The XML-RPC request document could not be parsed. http://weather.yahooapis.com/forecastrss?p=location bw black-and-white). site string: default no A domain to restrict your searches to (e.g. www.yahoo.com). You may you include Yahoo! Maps AJAX API library in your web page.This example uses the demonstration application value submit up to 30 values (site=www.yahoo.com&site=www.cnn.com). ID "YD-eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1H"; you cannot use this Application Forand must requestweather for Yahoo! Headquarters in Sunnyvale, CA, use the zip ID example, to get one code for Sunnyvale here. API Explorer (94089): output string: xml The format for the output. If json is requested, the results will be returned (default), json, php in JSON format. If php is requested, the results will be returned in Serialized PHP format. . <html> API Explorer : flickr.places.getPlaceTypes http://weather.yahooapis.com/forecastrss?p=94089 . <head> callback string The name of the callback function to wrap around the JSON data. The . <b><script type="text/javascript" Or use the Location ID for Sunnyvale (USCA1116): following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has . src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=YD- not been requested, this parameter has no effect. More information on the
  • 45. var map = new YMap (document.getElementById('map')); … dev var currentGeoPoint = new YGeoPoint ( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c
  • 46. dev YQL
  • 47. dev YQL
  • 48. dev Bindings YQL
  • 49. dev Bindings YQL
  • 50. dev Bindings YQL stmt YQL
  • 51. dev Bindings YQL stmt YQL select
  • 52. dev Bindings YQL stmt YQL select desc
  • 53. dev Bindings YQL stmt YQL select desc show
  • 54. select {what} from {service} where {condition}
  • 55. select {what} from {service} where {condition} show tables
  • 56. desc table select {what} from {service} where {condition} show tables
  • 57. desc table select {what} from {service} where {condition} show tables filtros remotos e locais
  • 65.
  • 66. • "Community Tables" são apenas arquivos XML
  • 67. • "Community Tables" são apenas arquivos XML • Qualquer um pode fazer
  • 68. • "Community Tables" são apenas arquivos XML • Qualquer um pode fazer • Manda lá pro Github http://www.datatables.org/ http://github.com/yql/yql-tables
  • 70.
  • 71. Começamos com um usuário do Meme http://meme.yahoo.com/caiocardoso
  • 72. SELECT * FROM meme.info WHERE name='caiocardoso'
  • 73. SELECT * FROM meme.info WHERE name='caiocardoso' "results":{    "meme":{     "guid":"66VIWI4DGQ44QE2VHU5EAT545E",     "name":"tommarques",     "title":"Tom Marques",     "description":null,     "url":"http://meme.yahoo.com/tommarques/",     "avatar_url":"http://d.yimg.com/gg/tommarques/ avatars/ 9bc435ebdc410b85f2971aba0800f806610d49ca.jpeg",     "language":"pt",     "followers":"131"    }   }
  • 74. Não esqueça! Você pode testar todas as queries mostradas aqui no console do YQL http://developer.yahoo.com/yql/console http://bit.ly/memeconsole
  • 75. SELECT * FROM meme.info WHERE name='caiocardoso' "results":{    "meme":{     "guid":"YZWI5S26GHSGODZHAXIQFQIQVU",     "name":"caiocardoso",     "title":"Caiocardoso",     "description":"Freelancer! conheça e contrate: www.caiocardoso.com =D",     "url":"http://meme.yahoo.com/caiocardoso/",     "avatar_url":"http://d.yimg.com/gg/caiocardoso/ avatars/bcc90c4338a59f963db4c101ee9c84edb2abfc42.jpeg",     "language":"pt",     "followers":"178"    }
  • 76. SELECT guid FROM meme.info WHERE name='caiocardoso'
  • 77. SELECT * FROM meme.posts WHERE owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' );
  • 78. SELECT * FROM meme.posts WHERE owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ); "post":[{      "pubid":"FSnvlto",      "guid":"YZWI5S26GHSGODZHAXIQFQIQVU",      "url":"http://meme.yahoo.com/caiocardoso/p/FSnvlto/",      "timestamp":"1264110678257",      "category":"photo",      "type":"photo",      "content":"http://d.yimg.com/gg/u/ ff25e03db0dcfbb1b6b4a9d4691d697b701dab48.jpeg",      "repost_count":"82",      "caption":"<b>Pac Man Ghosts</b>", ...
  • 80.
  • 81.
  • 82. SELECT * FROM meme.post.info WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' );
  • 83. SELECT * FROM meme.post.info(1000) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != '';
  • 84. SELECT * FROM meme.post.info(1000) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; {      "type":"comment",      "appid":null,      "guid":"AJX2LREON4SKPCFPUV77N3C6VE",      "pubid":"l2a-MOA",      "origin":"YZWI5S26GHSGODZHAXIQFQIQVU",      "origin_pubid":"Bza-m_n",      "via":"AJX2LREON4SKPCFPUV77N3C6VE",      "timestamp":"1268336540",      "comment":"BahÊa"     },
  • 85. Olha o que aconteceu nos bastidores: <diagnostics> <publiclyCallable>true</publiclyCallable> <url execution-time="33"><![CDATA[http://meme/api/v1/public/info/? name=caiocardoso]]></url> <url execution-time="563"><![CDATA[http://meme/api/v1/public/permalink/ info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=1&count=100]]></url> <url execution-time="631"><![CDATA[http://meme/api/v1/public/permalink/ info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=2&count=100]]></url> <url execution-time="611"><![CDATA[http://meme/api/v1/public/permalink/ info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=3&count=100]]></url> <url execution-time="643"><![CDATA[http://meme/api/v1/public/permalink/ info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=4&count=100]]></url> <url execution-time="936"><![CDATA[http://meme/api/v1/public/permalink/ info/?pubid=Bza-m_n&owner_guid=YZ...VU&page=5&count=100]]></url> <user-time>3427</user-time> <service-time>3417</service-time> <build-version>5275</build-version> </diagnostics>
  • 86. Conseguimos uma lista de lugares...
  • 87. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ"
  • 88. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ" "comment":"Pindamonhangaba e sim, a cidade existe."
  • 89. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ" "comment":"Pindamonhangaba e sim, a cidade existe." "comment":"putiz sou de cotia sp"
  • 90. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ" "comment":"Pindamonhangaba e sim, a cidade existe." "comment":"putiz sou de cotia sp" "comment":"Salvador...Baeeaaaaaaaaa"
  • 91. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ" "comment":"Pindamonhangaba e sim, a cidade existe." "comment":"putiz sou de cotia sp" "comment":"Salvador...Baeeaaaaaaaaa" "comment":"Boa noite memers, ah sou de Belém do Pará"
  • 92. Conseguimos uma lista de lugares... "comment":"ops, moro em Goias, mas sou do RJ" "comment":"Pindamonhangaba e sim, a cidade existe." "comment":"putiz sou de cotia sp" "comment":"Salvador...Baeeaaaaaaaaa" "comment":"Boa noite memers, ah sou de Belém do Pará" ... mas em linguagem beeem natural :(
  • 93.
  • 94. SELECT * FROM geo.places WHERE text = "o Rio de Janeiro continua lindo"
  • 95. SELECT * FROM geo.places WHERE text = "o Rio de Janeiro continua lindo" "place":{     "lang":"en-US",     "uri":"http://where.yahooapis.com/v1/place/ 455825",     "woeid":"455825",     "placeTypeName":{      "code":"7",      "content":"Town"     },     "name":"Rio de Janeiro",     "country":{      "code":"BR",      "type":"Country",      "content":"Brazil"     }, ...
  • 96. SELECT * FROM geo.places WHERE text = "o Rio de Janeiro continua lindo"
  • 97. SELECT * FROM geo.places WHERE text = "o Rio de Janeiro continua lindo"
  • 98.
  • 99. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid')
  • 100. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid')
  • 101. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid')
  • 102. Legal, conseguimos uma lista de woeids...
  • 103. Legal, conseguimos uma lista de woeids... { "woeid":"2344849", "yahoo:repeatcount":{ "field":"woeid", "content":"4" } }, { "woeid":"455847", "yahoo:repeatcount":{ "field":"woeid", "content":"1" } }, { "woeid":"2344856", "yahoo:repeatcount":{ "field":"woeid", "content":"19" }
  • 104. Legal, conseguimos uma lista de woeids... | unique(field='woeid')
  • 105. Legal, conseguimos uma lista de woeids... { "woeid":"2344849", "yahoo:repeatcount":{ | unique(field='woeid') "field":"woeid", "content":"4" } }, { "woeid":"455847", "yahoo:repeatcount":{ "field":"woeid", "content":"1" } }, { "woeid":"2344856", "yahoo:repeatcount":{ "field":"woeid", "content":"19" }
  • 106. E podemos ordená-la se estivermos a fim SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true")
  • 107. Blz, woeids ordenados por quantidade de ocorrências
  • 108. Blz, woeids ordenados por quantidade de ocorrências { "woeid":"455827", "yahoo:repeatcount":{ "field":"woeid", "content":"29" } }, { "woeid":"20105181", "yahoo:repeatcount":{ "field":"woeid", "content":"27" } }, { "woeid":"748328", "yahoo:repeatcount":{ "field":"woeid", "content":"26" }
  • 111. Estamos quase lá mas precisamos de uma ajuda...
  • 113. DESC flickr.photos.search <key name="machine_tags" type="xs:string"/> <key name="safe_search" type="xs:string"/> <key name="privacy_filter" type="xs:string"/> <key name="contacts" type="xs:string"/> <key name="tag_mode" type="xs:string"/> <key name="user_id" type="xs:string"/> <key name="license" type="xs:string"/> <key name="geo_context" type="xs:string"/> <key name="lat" type="xs:string"/> <key name="tags" type="xs:string"/> <key name="lon" type="xs:string"/> <key name="text" type="xs:string"/> <key name="max_taken_date" type="xs:string"/> <key name="is_commons" type="xs:string"/> <key name="radius" type="xs:string"/> <key name="woe_id" type="xs:string"/> <key name="has_geo" type="xs:string"/>
  • 114. SELECT * FROM flickr.photos.search WHERE text='brhackday'
  • 115. SELECT * FROM flickr.photos.search WHERE text='brhackday' SELECT * FROM flickr.photos.search WHERE is_commons='true'
  • 116. SELECT * FROM flickr.photos.search WHERE text='brhackday' SELECT * FROM flickr.photos.search WHERE is_commons='true' SELECT * FROM flickr.photos.search WHERE user_id='foobar'
  • 117. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true")
  • 118. SELECT * FROM flickr.photos.search(5) WHERE has_geo="true" and woe_id in ( SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true") )
  • 119. SELECT * FROM flickr.photos.search(5) WHERE has_geo="true" and woe_id in ( SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true") ) <results> <photo farm="3" id="4125642160" isfamily="0" isfriend="0" ispublic="1" owner="21381694@N07" secret="af0b6091b2" server="2629" title="Numa noite dessas, por ai..."/> <photo farm="3" id="4122278478" isfamily="0" isfriend="0" ispublic="1" owner="11264537@N05" secret="34f6ce4517" server="2660" title="AST Facilities 02"/> <photo farm="3" id="4055857251" isfamily="0" isfriend="0" ispublic="1" owner="44116004@N03" secret="5115fe3d9d" server="2538" title="Negao e Vinny"/> ...
  • 121.
  • 122.
  • 123. SELECT woeid, centroid.latitude, centroid.longitude FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true")
  • 124.
  • 125. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true")
  • 126. SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true") Em uma query, 3 sites/serviços diferentes, 3 APIs distintas
  • 127. SELECT * FROM flickr.photos.search(5) WHERE has_geo="true" and woe_id in ( SELECT woeid FROM geo.places WHERE text in ( SELECT comment FROM meme.post.info(500) WHERE pubid='Bza-m_n' AND owner_guid in ( SELECT guid FROM meme.info WHERE name='caiocardoso' ) AND comment != ''; ) | unique(field='woeid') | sort(field="yahoo:repeatcount", descending="true") ) Em uma query, 3 sites/serviços diferentes, 3 APIs distintas
  • 128. É mágico e revolucionário!
  • 129. É mágico e revolucionário!
  • 132. USE
  • 139. este é o YQL
  • 140. pra construir aplicações de forma mais fácil
  • 141. pra construir aplicações mais rápidas mais rápido
  • 142. serviço no cloud faz o trabalho processamento, filtros, conversões menos chamadas de serviços infraestrutura confiável
  • 145. Yahoo Query Language select * from internet Pedro Valente @pedrovalente