ReadIt
A very simple, read-only wrapper for the reddit api
Installation
Add this line to your application's Gemfile:
gem 'read_it'
And then execute:
$ bundle
Or install it yourself as:
$ gem install read_it
Usage
gifs = ReadIt::Sub.new 'gifs' # => #<ReadIt::Sub:0x007f837c168530 @name="/r/gifs">
random_post = gifs.sample # => #<ReadIt::Post:0x007f837c08b770...>
random_post.title # => "It was the best gif I'd seen all day"
random_post.image? # => true
random_post.nsfw? # => false
random_post.url # => "http://i.imgur.com/D4LcGLt.gif"
ReadIt.sub('babyelephantgifs').recent.first.url # => "http://i.imgur.com/fogh8W4.gif"
ReadIt.sub('avocadosgonewild').sample.nsfw? # => true
Returns recent posts from the sub reddit that have images
ReadIt.sub('formula1').recent_images
Contributing
- Fork it ( http://github.com/adamzaninovich/read_it/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request