diff --git a/plugins/scrape.rb b/plugins/scrape.rb index 2891137..5e69003 100644 --- a/plugins/scrape.rb +++ b/plugins/scrape.rb @@ -33,7 +33,8 @@ end DataMapper.auto_upgrade! Client.register_trigger("PRIVMSG") do |msg| - msg[:params].each do |word| + return 0 if msg[:params][1].nil? + msg[:params][1].split.each do |word| if word =~ /^https?:\/\// then original_url = word if word =~ /4cdn[.]org/ then @@ -52,6 +53,7 @@ Client.register_trigger("PRIVMSG") do |msg| ) Client.privmsg(msg[:params][0], Config[:scrape][:title_prefix] + title) if not title.nil? + return 0 end end end