Created
May 26, 2013 20:25
-
-
Save dwillis/5653908 to your computer and use it in GitHub Desktop.
Prototype NYT Article Search API (v2) wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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”?