https://github.com/adamzaninovich/read_it
A very simple wrapper for the reddit api
https://github.com/adamzaninovich/read_it
Last synced: 6 days ago
JSON representation
A very simple wrapper for the reddit api
- Host: GitHub
- URL: https://github.com/adamzaninovich/read_it
- Owner: adamzaninovich
- License: mit
- Created: 2014-08-23T21:21:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-24T00:22:30.000Z (over 10 years ago)
- Last Synced: 2025-04-22T15:56:04.371Z (27 days ago)
- Language: Ruby
- Homepage: https://github.com/adamzaninovich/read_it
- Size: 135 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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
```ruby
gifs = ReadIt::Sub.new 'gifs' # => #
random_post = gifs.sample # => #
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"
``````ruby
ReadIt.sub('babyelephantgifs').recent.first.url # => "http://i.imgur.com/fogh8W4.gif"
``````ruby
ReadIt.sub('avocadosgonewild').sample.nsfw? # => true
```Returns recent posts from the sub reddit that have images
```ruby
ReadIt.sub('formula1').recent_images
```## Contributing
1. Fork it ( http://github.com/adamzaninovich/read_it/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request