/rubyoverflow

rubyoverflow is a library for querying the Stack Exchange API

Primary LanguageRubyMIT LicenseMIT

rubyoverflow

rubyoverflow is a library for querying the Stack Overflow API

Build Status

<img src=“https://secure.travis-ci.org/kliuchnikau/rubyoverflow.png” />

Dependency Status

<img src=“https://gemnasium.com/danseaver/rubyoverflow.png” alt=“Dependency Status Gemnasium” />

Example

require 'rubyoverflow'

c = Rubyoverflow::Client.new
result = c.users.fetch(:id => 53587) # By default, this will query StackOverflow.com
me = result.users.first              # Get the first user out of the results
puts me.display_name                 # => "Dan Seaver"

c = Rubyoverflow::Client.new
c.users.each_fetch(:min => 100000) do | result_page |       # Query for all users with reputation higher than 1000
  result_page.users.each { |user| puts user.up_vote_count } # Print up votes count for these users
end

c = Rubyoverflow::Client.new :host => "http://api.serverfault.com" # Query ServerFault.com

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2011 Dan Seaver. See LICENSE for details.