Yahoo! Query Language (YQL) Guide Yahoo! Query Language (YQL) Guide

Yahoo! Query Language (YQL) Guide Yahoo! Query Language (YQL) Guide

Yahoo! Query Language (YQL) Guide Yahoo! Query Language (YQL) Guide Abstract This guide provides an overview of Yahoo! Query Language (YQL) along with information on how to use YQL to retrieve data from Yahoo! Social Directory, MyBlogLog, and data from other Yahoo! Web services. YQL also allows you to retrieve data from external sources such as the New York Times as well as feeds such as RSS and Atom. This guide is intended for software developers who are familiar with SQL, MySQL, or Yahoo! Pipes. Looking for more docs? See the Y!OS Documentation1 landing page. We welcome your feedback. Have a comment or question about this document? Let us know in the YDN Forum for Y!OS Documentation2. 1 /yos 2 http://developer.yahoo.net/forum/index.php?showforum=64 Table of Contents 1. Introducing YQL .............................................................................................................. 1 Introduction ................................................................................................................ 1 2. YQL Language Overview .................................................................................................. 2 YQL Language Overview ............................................................................................. 2 Dot-style syntax .................................................................................................. 2 3. Using YQL Statements ...................................................................................................... 4 Public and Private YQL Tables ....................................................................................... 4 Data Sets Available through YQL .................................................................................... 4 How YQL Treats Data .......................................................................................... 4 Extending and Customizing YQL ............................................................................ 5 Basic SELECT and FROM Statements ............................................................................ 5 Handling One-to-Many Relationships ...................................................................... 6 Local and Remote Filtering ........................................................................................... 7 Sub-Selects ................................................................................................................ 8 Paging and Limiting Table Size ...................................................................................... 8 Local Control ...................................................................................................... 8 Remote Control ................................................................................................... 9 Unbounded queries .............................................................................................. 9 Social Data and Me .............................................................................................. 9 Post-Query Filtering and Manipulation .................................................................... 9 DESC Statement ........................................................................................................ 10 SHOW Statement ....................................................................................................... 10 4. Running YQL Statements ................................................................................................. 11 Options for Running YQL Statements ............................................................................ 11 YQL Query Parameters ............................................................................................... 11 YQL Result Structure ................................................................................................. 11 SELECT diagnostics element ............................................................................... 12 Output: XML to JSON Conversion ................................................................................ 12 Output: Error Reporting .............................................................................................. 13 Trying YQL: The Testing Console ................................................................................. 13 YQL via PHP or Yahoo! Open Applications .................................................................... 13 Yahoo! Open Application Javascript .............................................................................. 14 2-Legged OAuth ........................................................................................................ 15 From Other Languages and Environments ....................................................................... 17 Authorization and Access Control ................................................................................. 17 Accessing YQL Public Data ................................................................................. 17 Accessing YQL using 2-Legged OAuth .................................................................. 17 3-Legged OAuth Access to YQL ........................................................................... 17 5. Using YQL Open Data Tables (BETA) ................................................................................ 18 Overview of Open Data Tables ..................................................................................... 18 Invoking an Open Data Table Definition within YQL ........................................................ 18 Open Data Tables Reference ........................................................................................ 19 tables element ................................................................................................... 19 meta sub-element ............................................................................................... 20 select sub-element .............................................................................................. 21 select/urls sub-element ........................................................................................ 21 select/execute sub-element ................................................................................... 22 key sub-element ................................................................................................. 22 select/paging sub-element .................................................................................... 24 paging/pagesize sub-element ................................................................................ 24 paging/start sub-element ...................................................................................... 24 Yahoo! Developer Network iii April 28, 2009 Yahoo! Query Language (YQL) Guide paging/total sub-element ..................................................................................... 25 Open Data Table Examples .......................................................................................... 25 Flickr Photo Search ............................................................................................ 25 Digg Events via Gnip .......................................................................................... 27 Twitter User Timeline ......................................................................................... 27 Open Data Tables Security and Access Control ................................................................ 28 Batching Multiple Calls into a Single Request ................................................................. 29 Troubleshooting ......................................................................................................... 29 6. Executing JavaScript in Open Data Tables (BETA) ................................................................ 31 Introduction .............................................................................................................. 31 Features and Benefits .......................................................................................... 31 Ensuring the Security of Private Information ................................................................... 31 JavaScript Objects and Methods Reference ..................................................................... 32 y Global Object ................................................................................................. 32 request Global Object ......................................................................................... 35 response Global Object ....................................................................................... 35 JavaScript and E4X Best Practices for YQL .................................................................... 35 Paging Results ................................................................................................... 35 Including Useful JavaScript Libraries ..................................................................... 36 Using E4X within YQL ....................................................................................... 36 Logging and Debugging ...................................................................................... 38 Examples of Open Data Tables with JavaScript ................................................................ 39 Hello World Table .............................................................................................. 39 Yahoo! Messenger Status ....................................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    55 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us