Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Ruby wrapper for Theoldreader's API.
Add this line to your application's Gemfile:
gem 'theoldreader-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install theoldreader-api
First you need to obtain a token for theoldreader user:
require 'theoldreader-api'
Theoldreader::Api.new.accounts_clientlogin(
Email: 'test@krasnoukhov.com', Passwd: '...', client: 'YourAppName'
)
=> {"SID"=>"none", "LSID"=>"none", "Auth"=>"LyTEJPvTJiSPrCxLu46d"}
With this token you have access to all other methods of Theoldreader's API.
api = Theoldreader::Api.new("LyTEJPvTJiSPrCxLu46d")
api.call!('get', '/reader/api/0/user-info', {output: 'json'})
call!
will pass every option you provide directly to Theoldreader's Api.
api.call('user-info')
api.call('subscription/quickadd', quickadd: 'http://xkcd.com')
api.call('tag/list')
api.call('/reader/subscriptions/export')
call
will filter your options to include only those listed in specification for the given endpoint.
call
accepts endpoints from Theoldreader::Api::ENDPOINTS.keys
as its first
Theoldreader::Api::ENDPOINTS
includes all available methods from Theoldreader's API (with 'reader/api/0/' being left out), except those three wich returns specific atom feeds (https://theoldreader.com/reader/atom/...). You can access them if you want with call!
If you mentally process your endpoint through .downcase.sub(%r{^/+}, '').gsub(%r{[-/]}, '_')
you should also get available method for Api.
# to get userinfo
api.user_info
# to add new feed
api.subscription_quickadd(quickadd: 'http://xkcd.com')
# to get the last two unread items
api.stream_contents(
s: 'user/-/state/com.google/reading-list',
xt: 'user/-/state/com.google/read',
n: 2
)
Works only for keys listed in Theoldreader::Api::ENDPOINTS.keys
You can change faraday adapter:
require 'net/http/persistent'
Theoldreader::Api.new('LyTEJPvTJiSPrCxLu46d', {adapter: :net_http_persistent})
And you can use API via http instead of https:
Theoldreader::Api.new('LyTEJPvTJiSPrCxLu46d', {use_ssl: false})
Bug reports and pull requests are welcome on GitHub at https://github.com/ilzoff/theoldreader-api.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that theoldreader-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.