Skip to content
JoshJGT edited this page Sep 13, 2010 · 7 revisions

About

YQL.el is a simple interface to YQL (Yahoo! Query Language),
a developer tool with a super-neat API which provides access to many Yahoo! web services
(such as flickr). The goal is to provide a simple, somewhat Lispy way to interact with YQL
without having to load up a browser (a lot of Emacs users live there — trust us!).

Usage

YQL supports three main statements: show, desc, and select (kind of like other *QLs).
So too does YQL.el.
YQL.el also contains filter functionality for making it easier to find what you need in the results.

Select:

(yql ’select “item.condition.temp” “weather.forecast” “location=30313”)

Desc:

(yql ’desc “flickr.places”)

Show:

(yql ’show)

Note that yql is just a macro that expands to one of yql-select, yql-desc, or yql-show.
So, feel free to just use those like you’d expect.

However, you don’t always want “just a tree” of data. That’s where yql-filter comes in.

(yql ’filter ’title (yql ’filter ’item (yql ’select “title,pubDate” “rss” “url=‘http://twitter.com/statuses/user_timeline/wfarr.rss’ LIMIT 1”))) ;; would return the text of my most recent tweet

As you can see, it’s pretty useful. For some examples of how to use these, check out
yql-twitter-stream or yql-yahoo-stocks.

Other Examples

Finds all the places in flickr.places with city name ‘Atlanta’:

(yql ’filter ’place (yql ’select “content” “flickr.places” “query=\”Atlanta\"")) ;; (“Atlanta, Georgia, United States” “Atlanta, Texas, United States” “Atlanta, Ohio, United States” “Atlanta, Missouri, United States” “Washington, United States” “Atlanta, Idaho, United States” “Atlanta, New York, United States” “Atlanta, Michigan, United States” “Atlanta, Kansas, United States” “Atlanta, Indiana, United States” “Atlanta, Nebraska, United States” “Atlanta, Louisiana, United States” …)

Fetching the most recent tweet for a given user (with a public profile):

(yql ’filter ’title (yql ’filter ’item (yql ’select “title,pubDate” “rss” “url=‘http://twitter.com/statuses/user_timeline/wfarr.rss’ LIMIT 1”))) ;; “wfarr: @20seven @joshjgt and I are working on our Yahoo Hack Week project, by creating an elisp library for it! http://tinyurl.com/c2eddc”

Some other examples will be here. If not, pretend.

Clone this wiki locally