Skip to content
Simple ruby wrapper for sending queries to YQL.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

YQL-Simple - A simple Ruby gem for YQL

This is Ruby gem makes working with YQL queries a little bit easier. It does not do anything fancy, it just sends an HTTP request to YQL with the given query and returns the results as a hash.


The gem is hosted on, so you just need to includ gem "yql_simple" in your Gemfile in order to install the gem.


Example of doing a twitter search. You can find the full code in the examples folder.

require "yql_simple"

simple_client =

query_string = 'SELECT * FROM WHERE q="#ruby" LIMIT 5'
response = simple_client.query(query_string)

response["query"]["results"]["results"].each do |tweet| 
  date = Time.parse(tweet["created_at"]).strftime("%Y-%m-%d %H:%M")  
  puts "[#{date}] #{tweet["from_user"]}: #{tweet["text"]}"

This will output something like this:

[2011-05-15 13:12] eyoosuf: Rails and Django for Quick thinking Developers, PHP for Lazy Developers #PHP #RUBY #ROR #PYTHON #Rails #Django
[2011-05-15 12:57] rudkovsky: Looking for a job! #rails #ruby #job



  • added OAuth supported for 2-legged OAuth with YQL

0.0.1 (unreleased)

  • added minimal RDoc documentation
  • RDoc will be generated with rake rdoc or when installing the gem
  • test installation via bundler and :git

Continuous Integration

Shows the current built status of this gem, as reported by Travis CI

Build Status

Notes for Contributors

I am using bundler for the fetching the dependencies, RSpec for the testing, and RDoc for code documentation.

  • build and install

    (sudo) rake install

  • run the tests (this will check for a folder 'spec' and run rspec against all _spec files)

    rake spec

  • generate rdoc (the rdoc documentation will be generated in ./doc)

    rake rdoc

  • get a list of rake tasks

    rake -T

  • building the gem

    gem build yql_simple.gemspec

Useful Reads for Gem Building

Alternative Gems

Something went wrong with that request. Please try again.