Skip to content

Instantly share code, notes, and snippets.

@kga
Created January 12, 2009 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kga/46073 to your computer and use it in GitHub Desktop.
Save kga/46073 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use URI;
use WWW::Mechanize;
my $url = URI->new(shift) or die;
my %query = $url->query_form;
my $code = $query{ref};
my $mech = WWW::Mechanize->new;
$mech->agent_alias( 'Windows IE 6' );
$mech->get($url);
$mech->submit_form( form_number => 1 );
open my $fh, '>', "$code.torrent";
print $fh $mech->res->content;
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment