Skip to content

Instantly share code, notes, and snippets.

@danishkhan
Created October 11, 2011 07:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danishkhan/1277483 to your computer and use it in GitHub Desktop.
Save danishkhan/1277483 to your computer and use it in GitHub Desktop.
Script to automatically download torrents from an RSS feed
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