Created
October 11, 2011 07:03
-
-
Save danishkhan/1277483 to your computer and use it in GitHub Desktop.
Script to automatically download torrents from an RSS feed
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
require 'rubygems' | |
require 'feedzirra' | |
require 'whenever' | |
=begin | |
Simple script to auto download new torrents from an RSS feed. | |
You can then utilize whenever and create a cronjob to run the | |
script at a specified interval. | |
=end | |
feed = Feedzirra::Feed.fetch_and_parse("RSS_Feed_URL") | |
updated_feed = Feedzirra::Feed.update(feed) | |
entries = feed.entries | |
if (updated_feed.updated? != nil) | |
entries.each do |entry| | |
url = entry.url | |
system(%Q{open -a /Applications/Transmission.app '#{url}'}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment