a simple api client for readability
Ruby
Pull request Compare This branch is 36 commits behind 29decibel:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
features
lib
spec
.gitignore
Gemfile
Guardfile
Rakefile
Readme.md
readability.yml.sample
readit.gemspec

Readme.md

Simple api client of readability

Installation

gem install readit

or in your rails gemfile

gem 'readit'
# or latest (recommend)
gem 'readit',:git=>'git@github.com:29decibel/readit.git'

Configuration

Rails

config/readability.yml

development:
  consumer_key: some_key
  consumer_secret: some_secret

or in your code

Readit::Config.consumer_key = some_key
Readit::Config.consumer_secret = some_value

API usage

Initialize api client

@api = Readit::API.new 'access_token','access_token_secret'

User info

# get user info
@api.me

Bookmarks

# get all bookmarks, result will be a hash array
@api.bookmarks

# add bookmark
bookmark_info = @api.bookmark(:url=>'http://some_article_url.html')
# check bookmarked infos
# bookmark_info.bookmark_id
# bookmark_info.article_id

# get bookmark by bookmark_id
@api.bookmarks :bookmark_id => some_bookmark_id

# archive a bookmark
@api.archive some_bookmark_id

# favorite a bookmark
@api.favorite some_bookmark_id

# or you can just call update_bookmark to 
# update a bookmark to favorited or archived
@api.update_bookmark bookmark_id,:favorite => 1,:archive => 0

Get Article

# get one artile by article_id
@api.article 'article_id'

At last but not least

Contributions are welcome!