Expand|Select|Wrap|Line Numbers
- use IO::Socket;
- my $path= "http://website.com/aaa.php";
- print q(
- __________
- -/* Script v1.0 *\-
- ------------------
- );
- print q(
- Link: );
- $postit = <STDIN>;
- chop($postit);
- $len = legth $postit;
- sub get_link() {
- $postit = shift;
- $len = shift;
- $path = shift;
- my $sock = new IO::Socket::INET(
- PeerAddr => "host.net",
- PeerPort => "80",
- Proto => "tcp",
- );
- die "ERROR";
- print $sock "POST $path HTTP/1.1\n";
- print $sock "Host: $hosting\n";
- print $sock "Accept: */*\n";
- print $sock "Referer: $path\n";
- print $sock "Accept-Language: en-us\n";
- print $sock "Content-Type: application/x-www-form-urlencoded\n";
- print $sock "User-Agent: SOME_UA\n";
- print $sock "Connection: Keep-Alive\n";
- print $sock "Length: $len\n";
- print $sock "Content: $postit\n";
- close($sock);
- $socket =~ /URL (.*) \(Hello there\) found at (.*)</body>/;
- @y = ($1, $2);
- return @y;
- echo "OK";
- }
- echo get_link($postit, $len, $path);
And what about the script, should that do what is supposed to, echo the stuff that the regexp gets ??