Platinum Partner

Perl Crawler

The following code is designed to print all the links found on the google home page.  I found it laying around in my old source-code folder, it may not be fully working.


#!/usr/bin/perl
use IO::Socket;

$socket = IO::Socket::INET->new(PeerAddr => 'google.com',
				PeerPort => 80,
				Proto => 'tcp',
				Type => SOCK_STREAM)
	or die "Couldn't connect";
print $socket "GET / HTTP/1.0\n\n";
#$page = <$socket>;
while (defined($line = <$socket>)) {
	$line =~ m{href="(.*?)"}ig;
	print "$1";
    }
close($socket);
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}