SlideShare ist ein Scribd-Unternehmen logo
1 von 36
YQL
Cody Schwebke
Yahoo!
DATA




http://www.flickr.com/photos/parkerblohm/6190781865/
(DATA) SILOS




http://www.flickr.com/photos/docsearls/5500714140/
THE INTERNET




http://www.flickr.com/photos/danndalf/3534506071/
APPLICATION PLUMBING




http://www.flickr.com/photos/russmorris/2713018257/
Y(AHOO!) Q(UERY) L(ANGUAGE)
                    SQL-like syntax
                    Query, filter, and join
                     across data sources
                    Not limited to Yahoo!
                     services
                    Easy to use web console
                     and table editor
                    Create custom tables
                     with your own server-
                     side logic using the
                     JavaScript execute
                     environment
YQL, CONT’D
 Compatible
       Accepts XML, JSON, CSV
       Returns XML, JSON, JSON-P
 High Performance
       Deployed around the globe
       Front and Back facing caches
       99.5%+ performance uptime target
 Rate-limited
       /v1/public/* - 2,000 requests/hour per IP
       /v1/yql/* - 20,000 requests/hour per IP
       Per application limit (identified by your Access Key):
        100,000 requests/day
QUERY SYNTAX
   Select {what} from {service} where {condition}
   Supports Select, Insert, Update, Delete
   Supports Joining with sub-selects
   Includes helper functions (sort, reverse, unique)
     Uses ‘|’ symbol
CONSOLE
CONSOLE OPTIONS
                                                       Create alias




Output type selection   Toggle diagnostics and debug
                        modes

REST query
REST QUERY
COMMUNITY TABLES
COMMUNITY TABLES
               151 community tables
               Everything from flickr to
               weather


               Click desc for more
               information on each table
FEED (RSS AGGREGATOR)
FEED, CONT’D
HTML
FLICKR
Get a Flickr API key:
http://www.flickr.com/services/apps/create/apply
FLICKR TEXT SEARCH
FLICKR TEXT SEARCH, CONT’D
FLICKR LOCATION SEARCH
LOCATION-BASED WEATHER
BUILD YOUR OWN TABLE
4 STEPS TO BUILD YOUR OWN TABLE
1. Define your table’s properties
2. Implement custom logic using JavaScript
   execute
3. Save your table to our servers
4. Call your new table from your application
PIG LATIN
• A language game played with the English
  language
• Popular with elementary school students
• Simple, algorithmic conversion
    •   pig = igpay
    •   computer = omputercay
    •   another = another-way
YQL EDITOR




             Click here
STEP 1
STEP 1, CONT’D    Optional meta
                    data




                           Table inputs




Path to repeating                    Custom JavaScript
 response items                      include
STEP 2
          Table inputs




                         Execute a sub-query




                                        “Lossless” JSON mode
 E4X – XML for
 JavaScript
STEP 3
         Click me!




              Reference keys
STEP 3.5, TEST IN CONSOLE




                 Execute key
STEP 4
END RESULT
RECAP – BUILDING A HACK WITH YQL
 Pick your data source
 Mix and match community tables in the console
 Build new a table if needed in the editor and test
  in the console
 Use YUI-YQL module to get data
 Or just call the REST query endpoint
ADDITIONAL RESOURCES
 Docs
       http://developer.yahoo.com/yql/guide/
       http://yuilibrary.com/yui/docs/yql/
 Community
       http://www.yqlblog.net/
       http://www.datatables.org/
       http://github.com/yql/yql-tables
 E4X
       https://developer.mozilla.org/en-
        US/docs/E4X/Processing_XML_with_E4X
QUESTIONS?

Weitere ähnliche Inhalte

Andere mochten auch (8)

Ubunturef
UbunturefUbunturef
Ubunturef
 
Mexico
MexicoMexico
Mexico
 
1樹林之美
1樹林之美1樹林之美
1樹林之美
 
Ms Ajax Dom Element Class
Ms Ajax Dom Element ClassMs Ajax Dom Element Class
Ms Ajax Dom Element Class
 
SAP HANA 1.0 ONLINE TRAINING
SAP HANA 1.0 ONLINE TRAININGSAP HANA 1.0 ONLINE TRAINING
SAP HANA 1.0 ONLINE TRAINING
 
手机上面的Ria应用
手机上面的Ria应用手机上面的Ria应用
手机上面的Ria应用
 
A samambaia e o bambu
A samambaia e o bambuA samambaia e o bambu
A samambaia e o bambu
 
Kerrang Magazine Deconstruction
Kerrang Magazine Deconstruction Kerrang Magazine Deconstruction
Kerrang Magazine Deconstruction
 

Ähnlich wie Open Hack Taiwan 2012

WPP Hackday presentation - YQL
WPP Hackday presentation - YQLWPP Hackday presentation - YQL
WPP Hackday presentation - YQL
sriramiyer2007
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis Hackday
Paul Donnelly
 
Yql V8
Yql V8Yql V8
Yql V8
JH Lee
 
Rapid API Development ArangoDB Foxx
Rapid API Development ArangoDB FoxxRapid API Development ArangoDB Foxx
Rapid API Development ArangoDB Foxx
Michael Hackstein
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
WO Community
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
seleniumconf
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
Ben Steinhauser
 

Ähnlich wie Open Hack Taiwan 2012 (20)

WPP Hackday presentation - YQL
WPP Hackday presentation - YQLWPP Hackday presentation - YQL
WPP Hackday presentation - YQL
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis Hackday
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Build your web apps with yql and yui
Build your web apps with yql and yuiBuild your web apps with yql and yui
Build your web apps with yql and yui
 
Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011Yahoo! Query Language - Hadoop India Summit 2011
Yahoo! Query Language - Hadoop India Summit 2011
 
Yui conf nov8-2010-introtoyql
Yui conf nov8-2010-introtoyqlYui conf nov8-2010-introtoyql
Yui conf nov8-2010-introtoyql
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
Yql V8
Yql V8Yql V8
Yql V8
 
Yql with geo
Yql with geoYql with geo
Yql with geo
 
Rapid API Development ArangoDB Foxx
Rapid API Development ArangoDB FoxxRapid API Development ArangoDB Foxx
Rapid API Development ArangoDB Foxx
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
Unlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin ArchitectureUnlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin Architecture
 
SplunkLive London 2014 Developer Presentation
SplunkLive London 2014  Developer PresentationSplunkLive London 2014  Developer Presentation
SplunkLive London 2014 Developer Presentation
 
Building Intelligent Search Applications with Apache Solr and PHP5
Building Intelligent Search Applications with Apache Solr and PHP5Building Intelligent Search Applications with Apache Solr and PHP5
Building Intelligent Search Applications with Apache Solr and PHP5
 
Query the web with YQL
Query the web with YQLQuery the web with YQL
Query the web with YQL
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Talking to Web Services
Talking to Web ServicesTalking to Web Services
Talking to Web Services
 

Open Hack Taiwan 2012

Hinweis der Redaktion

  1. One of the biggest hurdles at Hack events is data, and how to get it. The most important part of your application is the data. It’s the data that keeps your user’s coming back for more. Without it, all you’ve got is that snazzy UI.
  2. Individual companies build up massive virtual silos of data. Some companies make their data available over Web services, while others do not.
  3. But, the great thing is that the internet is really just a series of tubes and all those silos are connected by these tubes. Some tubes lead to RSS feeds, others to RESTful APIs, while some just lead to websites.
  4. It is our goalas hackers and makers to find new and interesting ways to combine the data available online to create new and interesting applications. This is where YQL comes in. YQL helps you to spend less time worrying about the plumbing of your application, and more time taking that data and creating value for your users.
  5. YQL stands for Yahoo! Query Language. It is an SQL-like language that allows you to query, filter, and join data across any number of different data sources. YQL is not limited to Yahoo! services, but we are nice and have already provided a number of freely accessible tables to get you started. You can also test out the tables on our easy to use web console. You can easily create your own tables which implement your own custom logic, allowing you to mash-up data to your hearts content, any way you would like to (More on this later).
  6. YQL is highly compatible. It is able to ingest data from XML, JSON, and CSV sources and then return XML, JSON, or JSON-P. YQL is deployed into our colos around the world. There are multiple levels of cache that you are able to use as a developer. There is a user-facing caching proxy server, an internal colo-wide memory cache, as well as a squid cache to capture responses from any backend APIs you call. All of these are controllable from with-in the JavaScript execute environment.YQL has a 99.5% performance uptime target, and can be used for commercial purposes, though it is rate limited. However, the YQL environment provided for use today is not rate limited.
  7. The syntax used in YQL is very simple, and should look very familiar if you have done any work with SQL databases.
  8. The best place to start learning how to use YQL is the YQL console.
  9. YQL supports 3 output types, JSON, JSON-P and XML. You can select which data type you would like here.The diagnostics mode toggle will tell the YQL server to output additional diagnostic information, including any information on any backend services it connected to, how many resource units were consumed, and any log statements from custom written server-side logic.Debug mode will enable additional logging.Creating a query alias will allow you to more easily re-run the same query at a later date without having to type it all in again.This is the URL that your external application can call to execute the the last query that was run on this console.
  10. What if we wanted to do a simple aggregation of the RSS feeds from TechCrunch and AllThingsD? This is simple with the feed table.
  11. We can use projection to only grab the data we need, and also use the built-in sort function to sort the entries by publication date.
  12. Pinterest doesn’t currently have a public API for it’s top 50 pins. But we can use the HTML table to make one.
  13. The first thing you need to do to be able to use the Flickr table is to grab a free Flickr API key. If you don’t already have one, you can apply for one at the link on the screen now.
  14. You’ll notice that this table doesn’t provide us with the URL to any of the images.
  15. To get the URLs, we need to call a different table. We can do this by using the photo search table as a sub-query to the photo sizes table. This will grab the URL for each of the photos in our search results.
  16. To help developers with the first 3 steps in developing their own YQL tables, we’ve developed the YQL editor.
  17. If you notice, this table is not using the URL block shown on the previous slide. This is because instead of calling another external web service, we are going to call a different community YQL table.
  18. jsonCompat prevents JSON numbers being turned into strings, and preserves single-item arrays.