Skip to content

Instantly share code, notes, and snippets.

@mnutt
Created September 15, 2009 21:56
Show Gist options
  • Select an option

  • Save mnutt/187679 to your computer and use it in GitHub Desktop.

Select an option

Save mnutt/187679 to your computer and use it in GitHub Desktop.
Torrentizer Flow
=======
creator POSTS to /create/#{feed_url}
sinatra adds url to Url db if url doesn't exist
sinatra 301 redirects creator to /made/#{hash}
hasher_loop do
feed_urls.all.each do |url|
hasher makes http request to url and fetches feed
next if feed has not changed
hasher parses feed finds file_urls
file_urls.each do |file_url|
if file_url hash does not exist
fetch file_url
sha1 hash file
mktorrent, save to /made/
modify feed to add file_url hash, torrent locations
end
write modified feed to /made/#{hash}.xml
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment