3 ms·
I wrote a program to find the shortest URL. Enjoy! #!/usr/bin/perl # use WWW::Mechanize; die "usage: $0 <url>" unless @ARGV;
by pkrumins 17y ago
I wrote a program to find the shortest URL. Enjoy!
#!/usr/bin/perl
#
use WWW::Mechanize;
die "usage: $0 <url>" unless @ARGV;
$name = 'a';
$m = WWW::Mechanize->new;
while (1) {
print "Trying http://to./$name\n";
$m->post('http://to./', {
url => $ARGV[0],
name => $name,
'Witz that URL!' => 'Witz that URL!'
});
unless ($m->content =~ /sorry/) {
print "You got http://to./$name\n";
exit(0);
}
$name++;
}