Skip to content
Browse files

Adding some CLI output when torrents get added

  • Loading branch information...
1 parent f4a8c13 commit a22b4137b76bfef76c6b1c9863dd818b76a8c27f @samfoo committed Mar 1, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 presents
View
10 presents
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby
+require 'set'
+
require './lib/santa'
require './lib/transmission'
-require 'pp'
-
base_directory = ARGV[1]
raise "#{base_directory} does not exist or isn't a directory" \
unless Dir.exists? base_directory
@@ -25,13 +25,19 @@ puts "Directory: #{base_directory}"
@transmission = Transmission.new port, transmission_directory, download_directory
@santa = Santa.new 'http://vivid-sword-3891.herokuapp.com/'
+@seen_magnets = Set.new
loop do
@santa.get do |magnets|
+ magnets.each do |m|
+ puts "--- got #{m.display_name}" unless @seen_magnets.member? m.info_hash
+ @seen_magnets << m.info_hash
+ end
magnets.each { |m| @transmission.add m }
end
@transmission.get do |magnets|
+ puts "--- publishing #{magnets}"
Santa.publish magnets
end

0 comments on commit a22b413

Please sign in to comment.
Something went wrong with that request. Please try again.