Code Monkey home page Code Monkey logo

readit's Introduction

Simple api client of readability

Installation

gem install readit

or in your rails gemfile

gem 'readit'
# or latest (recommend)
gem 'readit',:git=>'[email protected]: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
# get bookmarks along with meta info :
# item_count, item_count_total, num_pages, page
bookmarks,meta = @api.bookmarks(:include_meta => true)

# 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!

readit's People

Contributors

caojunvincent avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.