Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

juicer-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juicer-client

  • 1.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Juicer Client

The API client for the BBC News Labs Juicer API.

NOTE: the Juicer is an experiment run by the BBC News Labs. The API may change without notice, there are no uptime, reliability guarantees. Please take this as experimental sofware in front of experimental API.

Installation

Add this line to your application's Gemfile:

gem 'juicer-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install juicer-client

Usage

Using the library is very simple. You'll need to obtain an API key from BBC Developer Portal by signing up and registering a new app for the bbcrd-juicer-apis product in the API listing.

Once you have obtained an API key and have installed the gem, you can use it by requiring the juicer library and instantiating it with your API key:

require 'juicer'

juicer = Juicer.new("<your API key>")

Have a look at the documentation for the library on how to filter articles, find similar content, etc.

juicer.products
=> ["NewsWeb", "Twitter", "Monitoring", "TheMirror", "Jupiter", "TheGuardian", ...]

juicer.articles({text: "London",
                 product: ["NewsWeb"],
                 published_after: "2014-10-14"})
=> [{"title"=>"London Market Report",
     "description"=>"London Market Report",
     "cps_id"=>"news_web_0962731f8c375d5096590ca38cee96e0e408180d",
     "published"=>"2014-10-14T08:14:07.000Z",
     "url"=>"http://www.bbc.co.uk/news/business-29610241#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa",
     "highlight"=>false,
     "source"=>"NewsWeb",
     "format"=>"TextualFormat",
     "image"=>nil,
     "themes"=>[],
     "people"=>[],
     "places"=>[],
     "organisations"=>[{"kind"=>"Organisation", "name"=>"Burberry", ..}]},
    {...}]

juicer.similar_articles("news_web_0962731f8c375d5096590ca38cee96e0e408180d")
=> [{"score"=>1.8277457,
     "title"=>"Mulberry profit warning hits shares",
     "cps_id"=>"20038835",
     "created_at"=>"2012-10-23T12:58:45.247Z",
     "published_at"=>"2012-10-23T11:57:37Z",
     "url"=>"http://www.bbc.co.uk/news/business-20038835"},
    {...}]

Contributing

  1. Fork it ( https://github.com/BBC-News-Labs/juicer-client/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 a new Pull Request

FAQs

Package last updated on 23 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc