Module: C3D::Getter

Extended by:
Getter
Included in:
Getter
Defined in:
lib/c3d/actors/getter.rb

Instance Method Summary collapse

Instance Method Details

#get(blob_id) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/c3d/actors/getter.rb', line 7

def get blob_id
  if blob_id[0..1] == '0x'
    blob_id = blob_id[2..-1]
  end
  btih    = blob_id[0..39]
  dn      = blob_id[40..-1]
  mag_link = "magnet:?xt=urn:btih:" + btih + "&dn=" + dn
  Celluloid::Actor[:puller].create mag_link
  puts "[C3D::#{Time.now.strftime( "%F %T" )}] Getting >>\t\t" + mag_link
end