wget :
wget --user=someuser --password=somepass -O nul: "http://domain/index.html?next"
-O nul:
é para evitar criar um index.html
inútil.
Em um script .cmd
, use "http://domain/index.html?%~1"
.
curl :
curl -x someuser:somepass "http://domain/index.html?next" > nul:
Python com urllib
:
#!/usr/bin/perl
import sys, urllib
action = sys.argv[1]
urllib.urlopen('http://user:pass@domain/index.html?'+action)
Perl com LWP::UserAgent
:
#!/usr/bin/perl
use LWP::UserAgent;
my $action = $ARGV[0];
my $ua = LWP::UserAgent->new;
## Make sure you set the correct realm!
$ua->credentials(
'domain:80',
'realm',
'user' => 'password'
);
$ua->get('http://domain/index.html?'.$action);