be consistent.
parent
b813682d13
commit
31541f7cad
|
@ -3,15 +3,15 @@ require 'digest/md5'
|
||||||
|
|
||||||
include EventMachine::IRC::Commands
|
include EventMachine::IRC::Commands
|
||||||
|
|
||||||
Client.register_trigger("PRIVMSG") { |msg|
|
Client.register_trigger("PRIVMSG") do |msg|
|
||||||
msg[:params].each { |word|
|
msg[:params].each do |word|
|
||||||
if word =~ /4cdn[.]org/ then
|
if word =~ /4cdn[.]org/ then
|
||||||
ext = "." + word.sub(/.*[.]([^.]*)/, '\1') if word.match(/[^.]+[.][^.]+/)
|
ext = "." + word.sub(/.*[.]([^.]*)/, '\1') if word.match(/[^.]+[.][^.]+/)
|
||||||
content = open(word).read
|
content = open(word).read
|
||||||
md5 = Digest::MD5.hexdigest(content)
|
md5 = Digest::MD5.hexdigest(content)
|
||||||
File.open(Config[:scrape][:basepath] + md5 + ext, 'w') { |file|
|
File.open(Config[:scrape][:basepath] + md5 + ext, 'w') do |file|
|
||||||
file.write(content)
|
file.write(content)
|
||||||
}
|
|
||||||
end
|
end
|
||||||
}
|
end
|
||||||
}
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue