brainfart #3
This commit is contained in:
parent
180b5332de
commit
cc35419130
1 changed files with 2 additions and 2 deletions
|
@ -8,8 +8,8 @@ DataMapper.setup(:default, Config[:scrape][:db])
|
|||
|
||||
module Scrape
|
||||
def self.download(uri)
|
||||
ext = "." + word.sub(/.*[.]([^.]*)/, '\1') if word.match(/[^.]+[.][^.]+/)
|
||||
content = open(word).read
|
||||
ext = "." + uri.sub(/.*[.]([^.]*)/, '\1') if uri.match(/[^.]+[.][^.]+/)
|
||||
content = open(uri).read
|
||||
md5 = Digest::MD5.hexdigest(content)
|
||||
File.open(Config[:scrape][:basepath] + md5 + ext, 'w') do |file|
|
||||
file.write(content)
|
||||
|
|
Loading…
Reference in a new issue