Project

yql_simple

0.0
No commit activity in last 3 years
No release in over 3 years
Simple wrapper for calls to YQL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0
>= 0
 Project Readme

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.

Installation

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

Usage

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

require "yql_simple"

simple_client = YqlSimple::SimpleClient.new()

query_string = 'SELECT * FROM twitter.search 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"]}"
end

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
[...]

Releases

0.0.2

  • 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

https://github.com/nas/yql