Last active
December 19, 2015 03:59
-
-
Save mizoR/5894322 to your computer and use it in GitHub Desktop.
This file contains 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
macaroni --recipe my_recipe.rb --target news |
This file contains 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
include Macaroni::Plugin | |
pipe :news do | |
plug Input::RSS, 'http://news.yahoo.com/rss/' | |
plug Input::RSS, 'https://news.google.com/news/feeds?cf=all&ned=us&hl=en&output=rss' | |
plug Filter::Sort do |a, b| | |
b.date_published <=> a.date_published | |
end | |
plug Filter::Slice, 1, 5 | |
plug Filter::Map do |row| | |
{:title => row.title, :url => row.url} | |
end | |
plug Output::Stdout | |
end |
This file contains 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
{:title=>"Plaintiffs in Calif. marriage case marry in SF", :url=>"http://news.yahoo.com/plaintiffs-calif-marriage-case-marry-sf-000449812.html"} | |
{:title=>"Obama yet to have African legacy like predecessors - Houston Chronicle", :url=>"http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGQLT2e30BTh-bVNWOZSPN6hbqFkQ&url=http://www.chron.com/news/politics/article/Obama-yet-to-have-African-legacy-like-predecessors-4630606.php"} | |
{:title=>"Plaintiffs in Calif. gay marriage case wed in SF", :url=>"http://news.yahoo.com/plaintiffs-calif-gay-marriage-case-wed-sf-235831059.html"} | |
{:title=>"End of era as Celtics rebuild without Pierce", :url=>"http://news.yahoo.com/end-era-celtics-rebuild-without-pierce-203533133.html"} | |
{:title=>"'Preposterous' to suggest Cartwright betrayed US, lawyer says - NBCNews.com", :url=>"http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGt8aynSXvEm0sAYhjJKPVTMMp7Kg&url=http://www.nbcnews.com/video/nightly-news/52345858/"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment