Permalink
Browse files

added README and LICENSE

  • Loading branch information...
1 parent 142814d commit 4accf6c0e6c013a565453c81644ee15f6fe5dfed @dwillis dwillis committed Dec 14, 2011
Showing with 70 additions and 1 deletion.
  1. +13 −0 LICENSE
  2. +56 −0 README.rdoc
  3. +1 −1 test/times_wire/test_item.rb
View
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2011 Derek Willis
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this library except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
View
56 README.rdoc
@@ -0,0 +1,56 @@
+ ____ __ __ __ ___ ___ _ _ __ ___ ___
+(_ _)( )( \/ )( _)/ __) ( \/\/ )( )( ,) ( _)
+ )( )( ) ( ) _)\__ \ \ / )( ) \ ) _)
+ (__) (__)(_/\/\_)(___)(___/ \/\/ (__)(_)\_)(___)
+
+Times Wire is a Ruby gem for interacting with The New York Times Newswire API (http://developer.nytimes.com/docs/read/times_newswire_api), which provides an up-to-the-minute stream of articles and blog posts published on NYTimes.com and The International Herald-Tribune.
+
+== News
+
+* Dec. 13, 2011: Version 0.5.0 released.
+
+== Installation
+
+Install Times Wire as a gem:
+
+ gem install times_wire
+
+For use in a Rails 3 application, put the following in your Gemfile:
+
+ gem "times_wire", "~> 0.5.0"
+
+then issue the 'bundle install' command. Times Wire has been tested under Ruby 1.8.7.
+
+== Getting Started
+
+You'll need an API Key from The New York Times Developer Network (http://developer.nytimes.com/). You can set your key as an environment variable (handy for running the test suite) or set it within a script or app:
+
+ TimesWire::Base.api_key = API_KEY
+
+Times Wire allows users to retrieve news items by source ('nyt', 'iht' or 'all'), by section (such as 'world', 'u.s.', 'sports') or by NYTimes.com blog names ("The Caucus", "FiveThirtyEight" or "At War", for example). Building a request is easy. To retrieve the latest items from The New York Times:
+
+ @items = Item.latest('nyt')
+
+By default, 20 items are returned, but you may change the limit in any request:
+
+ @items = Item.latest('iht', 15)
+
+Limiting the items retrieved to a section of The Times is easy, too. For a list of sections, please see the Newswire API documentation (http://developer.nytimes.com/docs/read/times_newswire_api):
+
+ @items = Item.section('nyt', 'world')
+
+Retrieving items from a single Times blog is similar:
+
+ @items = Item.blog_name('nyt', 'u.s.', 'The Caucus')
+
+== Future Development
+
+On the list for future additions is the ability to limit requests to a specific number of hours and to support offsets. Patches, pull requests and feature ideas welcomed.
+
+== Authors
+
+Derek Willis, dwillis@nytimes.com
+
+== Copyright
+
+Copyright (c) 2011 Derek Willis. See LICENSE for details.
View
2 test/times_wire/test_item.rb
@@ -51,7 +51,7 @@ class TestTimesWire::TestItem < Test::Unit::TestCase
context "create list of items from The Caucus blog" do
setup do
- @items = Item.blog_name('nyt', 'U.S.', 'The Caucus')
+ @items = Item.blog_name('nyt', 'u.s.', 'The Caucus')
end
should "return an array of objects of the Item type from the NYT U.S. section and Caucus blog" do

0 comments on commit 4accf6c

Please sign in to comment.