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

mccandlish

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mccandlish

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

McCandlish

A thin Ruby wrapper for NYT Article Search API Version 2. The name comes from McCandlish Phillips, "a tenacious reporter and a lyrical stylist" for The New York Times from 1952 to 1973.

THIS LIBRARY IS IN ALPHA STATE AND WILL CHANGE FREQUENTLY. DO NOT USE IT FOR ANYTHING, REALLY

Installation

Add this line to your application's Gemfile:

gem 'mccandlish'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mccandlish

Usage

You'll need an API key from The New York Times. Reading the Article Search V2 API docs wouldn't hurt, either. But once you have a key, you can get started like so:

require 'mccandlish'
# create a client
c = Mccandlish::Client.new('YOUR-API-KEY')
# retrieve API results for articles and blog posts mentioning Afghanistan from the Foreign Desk on May 26, 2013:
results = c.desk("Foreign").date("2013-05-26").query("Afghanistan").result
results.hits
 => 4
article = results.articles.first
=> #<Mccandlish::Article:0x007fca04897b20 @id="51a176ad46fdbf6c1db79139", @web_url="http://www.nytimes.com/2013/05/26/world/asia/in-afghan-transition-us-forces-take-a-step-back.html", @snippet="As the United States military moves into a support role in Afghanistan, a week spent with a brigade accompanying Afghan forces offered a direct look at the evolving training mission, for better or for worse.", ... @type_of_material="News", @word_count=1243>
article.headline
=> "In Afghan Transition, U.S. Forces Take a Step Back"

Contributing

  1. Fork it
  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 new Pull Request

FAQs

Package last updated on 27 May 2013

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