Simple api client of InoReader
This gem is Simple api client of InoReader
InoReader official API is here
Add this line to your application's Gemfile:
gem 'inoreader-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install inoreader-api
require 'inoreader-api'
inoreader = InoreaderApi::Api.new(:username => 'username', :password => 'password')
inoreader.auth_token # => 'G2UlCa...Fx'
require 'inoreader-api'
inoreader = InoreaderApi::Api.new(:auth_token => 'yourtoken')
inoreader.auth_token # => yourtoken
inoreader.token # => yourtoken
user = inoreader.user_info
user.userId # => '1005921515'
user.userName # => 'Jacket'
unread = inoreader.unread_counters
unread.max # => 1000
inoreader.user_subscription
inoreader.user_tags_folders
For additional parameter about any of the request, see the http://wiki.inoreader.com/doku.php?id=api#stream_contents
# retrieve all feed item
inoreader.items
# => #<Hashie::Mash continuation="bHe_p00GLz2u" description="" direction="ltr"...
# with parameter
inoreader.items('feed/http://feeds.test.com/',{
:n => 10,
:r => 'o',
:ot => '1389756192',
:xt => 'user/-/state/com.google/read',
:it => 'user/-/state/com.google/read',
:c => 'Beg3ah6v3'
})
# retrieve all item ids
inoreader.item_ids
# => #<Hashie::Mash continuation="eCpdOmg58fOF" itemRefs=[...
# with parameter
inoreader.item_ids('feed/http://feeds.test.com/',{
:n => 10,
:r => 'o',
:ot => '1389756192',
:xt => 'user/-/state/com.google/read',
:it => 'user/-/state/com.google/read',
:c => 'Beg3ah6v3'
})
inoreader.rename_tag('oldtag','newtag') # => 'OK'
inoreader.disable_tag('tagname') # => 'OK'
inoreader.add_tag('1719158580', 'user/-/state/com.google/read') # => 'OK'
# or
inoreader.add_tag('tag:google.com,2005:reader/item/000000006678359d', 'user/-/state/com.google/read') # => 'OK'
inoreader.remove_tag('1719158580', 'user/-/state/com.google/read') # => 'OK'
# or
inoreader.remove_tag('tag:google.com,2005:reader/item/000000006678359d', 'user/-/state/com.google/read') # => 'OK'
# specify label
inoreader.mark_all_as_read(1373407120123456, 'user/-/label/Google') # => 'OK'
# or feed
inoreader.mark_all_as_read(1373407120123456, 'feed/http://feeds.test.com/') # => 'OK'
inoreader.add_subscription('http://newfeeditem.com/')
# => #<Hashie::Mash numResults=1 query="http://newfeeditem.com/" streamId="feed/http://rss.newfeeditem.com/feeds">
inoreader.rename_subscription('feed/http://rss.newfeeditem.com/feeds', 'new title') # => 'OK'
inoreader.add_folder_subscription('feed/http://rss.newfeeditem.com/feeds', 'folderName') # => 'OK'
inoreader.remove_folder_subscription('feed/http://rss.newfeeditem.com/feeds', 'folderName') # => 'OK'
inoreader.unsubscribe('feed/http://rss.newfeeditem.com/feeds') # => 'OK'
inoreader.subscribe('feed/http://rss.newfeeditem.com/feeds') # => 'OK'
# with folder
inoreader.subscribe('feed/http://rss.newfeeditem.com/feeds', 'newFolder') # => 'OK'
inoreader.preferences_list
# => #<Hashie::Mash prefs=[#<Hashie::Mash id="lhn-prefs" value="{\"subscriptions\":{\"ssa\":\"false\"}}">]>
inoreader.stream_preferences_list
# => #<Hashie::Mash streamprefs=#<Hashie::Mash...
inoreader.set_subscription_ordering('user/-/state/com.google/root', '00A3AAB000B9C8F9')# => 'OK'
If you attach the :return_httparty_response => true
when the initiarize, you can return the response of httparty.
inoreader = InoreaderApi::Api.new(
:auth_token => 'token',
:return_httparty_response => true
)
inoreader.item_ids
# <HTTParty::Response:0x7fe10416dd60 parsed_response={"items"=>[], "itemRefs"=>[{"id"=>"1719385305", "directStreamIds"=>[], ...
- Fork it
- 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