Yql And Its Hotness

Post on 20-Jan-2015

1710 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

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.

Transcript

YQL(and its hotness)

YQL is Yahoo! Query Language

Yahoo! calls it:

A “mediator service” that enables developers to

query, filter, and combine data across Yahoo! and

beyond.

I call it:

An API for the

public internet.

I think my description is a bit

more catchy.

YQL offers a SQL-like syntax.

SELECT * FROM search.web

WHERE query="ruby"

Look familiar?

SELECT what FROM tableWHERE filter

Tables in YQL are much the same as

tables in SQL.

SELECT * FROM search.web

WHERE query="ruby"

You can SELECT specific elements

or objects.

SELECT title FROM search.web

WHERE query="ruby"

WHERE filters have lots of operators.

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

IS NOT NULLAND OR

Join tables with sub-selects using matching values as

a foreign key.

What is a YQL table?

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

APIs.

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

Tables are defined in XML.

<?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>

You can write your own.

And share them for others to use.

SHOW tablesDESC table

What’s the output?

<?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>

Specify callback with ‘callback’

for JSON-P.

Where is all this?

Examples

I converted the GitHub Activity Badge today.

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

lachlanhardy/github-activity-badge/

Oh!

And I built this...

Thank you

top related