Created
September 26, 2013 14:31
-
-
Save lei-clearsky/6715041 to your computer and use it in GitHub Desktop.
Revisions
-
lei-clearsky created this gist
Sep 26, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ def get_from_digg res = JSON.load(RestClient.get('http://digg.com/api/news/popular.json')) res["data"]["feed"].map do |story| s = {} tags = [] s[:title] = story["content"]["title"] story["content"]["tags"].map do |tag| tags << tag["display"] end s[:category] = tags.join(", ") calculate_upvotes s puts show_new_story(s) end end