Skip to content

Instantly share code, notes, and snippets.

@dwillis
Created May 26, 2013 20:25
Show Gist options
  • Select an option

  • Save dwillis/5653908 to your computer and use it in GitHub Desktop.

Select an option

Save dwillis/5653908 to your computer and use it in GitHub Desktop.
Prototype NYT Article Search API (v2) wrapper
# Goals: allow chained methods with clear syntax
c = Mccandlish::Client.new('API_KEY')
c.query("Anthony Weiner").year(2013).location("New York City").result
# other methods include many of these: http://developer.nytimes.com/docs/read/article_search_api_v2#filters-fields
@migurski
Copy link

Method chains make me a little cross-eyed, but if you can provide a solid dictionary of what exactly works where then it should work well. Is the idea that nothing actually gets executed until you ask for “.result”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment