#!/usr/bin/perl
use strict;
use IO::Socket;
open (PUBTEXT, ">newpubtext.txt");
sub getdata
{
my $url = shift;
my $postinfo = "GET /".$url." HTTP/1.1\n";
$postinfo .= "Accept: */*\n";
$postinfo .= "Accept-Language: en\n";
$postinfo .= "Accept-Encoding: text/*\n";
$postinfo .= "Connection: keep-alive\n";
$postinfo .= "Host: www.westaussie.com\n";
my $sock = new IO::Socket::INET (PeerAddr => 'www.westaussie.com', PeerPort => '80', Proto => 'tcp');
print $sock $postinfo . "\n";
my @data = ();
while ( defined (my $line = <$sock>)) { push(@data,$line); }
for (my $x = 0; $x < scalar(@data); $x++)
{
if (@data[$x] =~ m/> (.*) (.*)<\/strong>
/) {
print "Pub: $1\n";
print PUBTEXT $1 . "|";
if (@data[$x+1] =~ m/ (.*)
/) {
print "Address: $1\n\n";
print PUBTEXT $1 . "\n";
}
}
# print @data[$x];
}
}
# &getdata("pages/attadalewa1-2-1.php");
my $postinfo = "GET /sitemap.php HTTP/1.1\n";
$postinfo .= "Accept: */*\n";
$postinfo .= "Accept-Language: en\n";
$postinfo .= "Accept-Encoding: text/*\n";
$postinfo .= "Connection: keep-alive\n";
$postinfo .= "Host: www.westaussie.com\n";
my $sock = new IO::Socket::INET (PeerAddr => 'www.westaussie.com', PeerPort => '80', Proto => 'tcp');
print $sock $postinfo . "\n";
my @data = ();
while ( defined (my $line = <$sock>)) { push(@data,$line); }
close ($sock);
my $rawpubs = @data[197];
my @shiznit = split(/\"/, $rawpubs);
for (my $y = 0; $y < scalar(@shiznit); $y++)
{
if (@shiznit[$y] =~ /1-2-1/)
{
print @shiznit[$y] . "\n";
&getdata(@shiznit[$y]);
}
}
close (PUBTEXT);