Top Banner
YQL (and its hotness)
44

Yql And Its Hotness

Jan 20, 2015

Download

Technology

Lachlan Hardy

I gave a presentation to RORO in Sydney on 2009-02-17 about Yahoo! Query Language (YQL) and why I think it's hot. I wound up with a couple of demos including the new version of the GitHub Activity Badge and a Flickr slideshow site I built just for the presentation called StreamSlide.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Yql And Its Hotness

YQL(and its hotness)

Page 2: Yql And Its Hotness

YQL is Yahoo! Query Language

Page 3: Yql And Its Hotness

Yahoo! calls it:

Page 4: Yql And Its Hotness

A “mediator service” that enables developers to

query, filter, and combine data across Yahoo! and

beyond.

Page 5: Yql And Its Hotness

I call it:

Page 6: Yql And Its Hotness

An API for the

public internet.

Page 7: Yql And Its Hotness

I think my description is a bit

more catchy.

Page 8: Yql And Its Hotness

YQL offers a SQL-like syntax.

Page 9: Yql And Its Hotness

SELECT * FROM search.web

WHERE query="ruby"

Page 10: Yql And Its Hotness

Look familiar?

Page 11: Yql And Its Hotness

SELECT what FROM tableWHERE filter

Page 12: Yql And Its Hotness

Tables in YQL are much the same as

tables in SQL.

Page 13: Yql And Its Hotness

SELECT * FROM search.web

WHERE query="ruby"

Page 14: Yql And Its Hotness

You can SELECT specific elements

or objects.

Page 15: Yql And Its Hotness

SELECT title FROM search.web

WHERE query="ruby"

Page 16: Yql And Its Hotness

WHERE filters have lots of operators.

Page 17: Yql And Its Hotness

= =! > < <= >=IN LIKE IS NULL

IS NOT NULLAND OR

Page 18: Yql And Its Hotness

Join tables with sub-selects using matching values as

a foreign key.

Page 19: Yql And Its Hotness

What is a YQL table?

Page 20: Yql And Its Hotness

The defaults are mostly data sources for Yahoo's own data

APIs.

Page 21: Yql And Its Hotness

Some for HTML, JSON, XML, RSS, ATOM, CSV, feeds and microformats.

Page 22: Yql And Its Hotness

Tables are defined in XML.

Page 23: Yql And Its Hotness

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <author>Paul Daniel</author> <documentationURL>http://apiwiki.twitter.com/REST+API+Documentation#show</documentationURL> </meta> <bindings> <select itemPath="feed.entry" produces="XML"> <urls> <url>http://twitter.com/statuses/user_timeline/{id}.atom</url> </urls> <paging model="page"> <start default="0" id="page"/> <pagesize max="200" id="count"/> <total default="20"/> </paging> <inputs> <key id="since" type="xs:string" paramType="query" /> <key id="since_id" type="xs:string" paramType="query" /> <key id="id" type="xs:string" paramType="path" required="true"/> </inputs> </select> </bindings></table>

Page 24: Yql And Its Hotness

You can write your own.

Page 25: Yql And Its Hotness

And share them for others to use.

Page 26: Yql And Its Hotness

SHOW tablesDESC table

Page 27: Yql And Its Hotness
Page 28: Yql And Its Hotness

What’s the output?

Page 29: Yql And Its Hotness

<?xml version="1.0" encoding="UTF-8"?><query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="10" yahoo:created="2009-02-11T03:16:48Z" yahoo:lang="en-US" yahoo:updated="2009-02-11T03:16:48Z" yahoo:uri="http://query.yahooapis.com/v1/yql?q=SELECT+*+%0AFROM+search.web+WHERE+query%3D%22ruby%22"> <diagnostics> <publiclyCallable>true</publiclyCallable> <url execution-time="116">http://boss.yahooapis.com/ysearch/web/v1/ruby?format=xml&amp;start=0&amp;count=10</url> <user-time>119</user-time> <service-time>116</service-time> <build-version>851</build-version> </diagnostics> <results> <result xmlns="http://www.inktomi.com/"> <abstract><![CDATA[<b>Ruby</b> originated in Japan during the mid-1990s and was initially developed and <b>...</b> <b>Ruby</b> supports multiple programming paradigms, including functional, object <b>...</b>]]></abstract> <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTQ4NWxyYWUxBF9TAzIwMjMxNTI3MDIEYXBwaWQDb0pfTWdwbklrWW5CMWhTZnFUZEd5TkouTXNxZlNMQmkEcG9zAzEEc2VydmljZQNZU2VhcmNoV2ViBHNsawN0aXRsZQRzcmNwdmlkA253RkNNVVBEQjJIMkxjVFRsQWt1ZVI0VXl6LkNJVW1TUXlBQUFLckk-/SIG=11tsuk1oo/**http%3A//en.wikipedia.org/wiki/Ruby_(programming_language)</clickurl>

Page 31: Yql And Its Hotness

Specify callback with ‘callback’

for JSON-P.

Page 34: Yql And Its Hotness

Where is all this?

Page 37: Yql And Its Hotness
Page 38: Yql And Its Hotness

Examples

Page 39: Yql And Its Hotness

I converted the GitHub Activity Badge today.

Page 40: Yql And Its Hotness

Took me 5 minutes.http://github.com/

lachlanhardy/github-activity-badge/

Page 41: Yql And Its Hotness

Oh!

And I built this...

Page 43: Yql And Its Hotness

Thank you

Page 44: Yql And Its Hotness

http://lachstock.com.au