https://github.com/fteem/hackernews_api
I hug HN's API. Using Ruby.
https://github.com/fteem/hackernews_api
Last synced: 25 days ago
JSON representation
I hug HN's API. Using Ruby.
- Host: GitHub
- URL: https://github.com/fteem/hackernews_api
- Owner: fteem
- License: mit
- Created: 2014-10-08T21:13:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-09T00:06:16.000Z (over 11 years ago)
- Last Synced: 2025-12-28T21:59:07.557Z (6 months ago)
- Language: Ruby
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HackernewsApi
This is a tiny gem that wraps around HN's API.
## Installation
Add this line to your application's Gemfile:
gem 'hackernews_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hackernews_api
## Usage
Fetching users by id:
```ruby
User.fetch(123)
```
Fetching stories:
```ruby
Story.fetch(123)
```
Fetching comment:
```ruby
Comment.fetch(123
```
Fetching poll:
```ruby
Poll.fetch(123)
```
All of the fetch actions return adequate entities based on the fetch.
For example, ```Story.fetch()``` will return a ```Story``` object.
## Versioning
The gem version will **always** follow the API version. Right now, while the API is v0, the gem will have a version of 0.x.x.
When YC update the API, the new gem will be released under the same version.
## Contributing
1. Fork it ( http://github.com/fteem/hackernews_api/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