mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 03:33:06 +01:00
Dump LWP error text if get_title.pl fails to fetch webpage
This commit is contained in:
parent
838f232d68
commit
fa2e3e4b5d
@ -13,7 +13,7 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 781,
|
||||
BUILD_REVISION => 782,
|
||||
BUILD_DATE => "2014-08-31",
|
||||
};
|
||||
|
||||
|
@ -15,29 +15,31 @@ if ($#ARGV <= 0)
|
||||
my $nick = shift(@ARGV);
|
||||
$arguments = join("%20", @ARGV);
|
||||
|
||||
exit if($arguments =~ m/stackoverflow.com/i);
|
||||
exit if($arguments =~ m/scratch.mit.edu/i);
|
||||
exit if($arguments =~ m/imgur.com/i);
|
||||
exit if($arguments =~ m/sprunge.us/i);
|
||||
exit if($arguments =~ m/pastebin.ws/i);
|
||||
exit if($arguments =~ m/hastebin.com/i);
|
||||
exit if($arguments =~ m/lmgtfy.com/i);
|
||||
exit if($arguments =~ m/gyazo/i);
|
||||
exit if($arguments =~ m/imagebin/i);
|
||||
exit if($arguments =~ m/\/wiki\//i);
|
||||
exit if($arguments =~ m/github.com/i);
|
||||
exit if($arguments =~ m/wiki.osdev.org/i);
|
||||
exit if($arguments =~ m/wikipedia.org/i);
|
||||
exit if($arguments =~ m/everfall.com/i);
|
||||
exit if($arguments =~ m/fukung.net/i);
|
||||
exit if($arguments =~ m/\/paste\//i);
|
||||
exit if($arguments =~ m/paste\./i);
|
||||
exit if($arguments =~ m/pastie/i);
|
||||
exit if($arguments =~ m/ideone.com/i);
|
||||
exit if($arguments =~ m/codepad.org/i);
|
||||
exit if($arguments =~ m/^http\:\/\/past(e|ing)\./i);
|
||||
exit if($arguments =~ m/paste.*\.(?:com|org|net|ch|ca|de|uk|info)/i);
|
||||
exit if($arguments =~ m/pasting.*\.(?:com|org|net|ca|de|uk|info|ch)/i);
|
||||
exit if $arguments =~ m/explosm.net/i;
|
||||
exit if $arguments =~ m/stackoverflow.com/i;
|
||||
exit if $arguments =~ m/scratch.mit.edu/i;
|
||||
exit if $arguments =~ m/c-faq.com/i;
|
||||
exit if $arguments =~ m/imgur.com/i;
|
||||
exit if $arguments =~ m/sprunge.us/i;
|
||||
exit if $arguments =~ m/pastebin.ws/i;
|
||||
exit if $arguments =~ m/hastebin.com/i;
|
||||
exit if $arguments =~ m/lmgtfy.com/i;
|
||||
exit if $arguments =~ m/gyazo/i;
|
||||
exit if $arguments =~ m/imagebin/i;
|
||||
exit if $arguments =~ m/\/wiki\//i;
|
||||
exit if $arguments =~ m/github.com/i;
|
||||
exit if $arguments =~ m/wiki.osdev.org/i;
|
||||
exit if $arguments =~ m/wikipedia.org/i;
|
||||
exit if $arguments =~ m/everfall.com/i;
|
||||
exit if $arguments =~ m/fukung.net/i;
|
||||
exit if $arguments =~ m/\/paste\//i;
|
||||
exit if $arguments =~ m/paste\./i;
|
||||
exit if $arguments =~ m/pastie/i;
|
||||
exit if $arguments =~ m/ideone.com/i;
|
||||
exit if $arguments =~ m/codepad.org/i;
|
||||
exit if $arguments =~ m/^http\:\/\/past(e|ing)\./i;
|
||||
exit if $arguments =~ m/paste.*\.(?:com|org|net|ch|ca|de|uk|info)/i;
|
||||
exit if $arguments =~ m/pasting.*\.(?:com|org|net|ca|de|uk|info|ch)/i;
|
||||
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->agent("Mozilla/5.0");
|
||||
@ -48,6 +50,8 @@ my $response = $ua->get("$arguments");
|
||||
if (not $response->is_success)
|
||||
{
|
||||
#print "Couldn't get link.\n";
|
||||
use Data::Dumper;
|
||||
print STDERR Dumper $response;
|
||||
die "Couldn't get link: $arguments";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user