All pastes #423479 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-04 05:48 UTC
rendered paste body
#!/usr/bin/perl -w
#
# this is a script to sort out the
# websites passed back to you
# when using whois.webhosting.info's
# reverse ip tool to make it so it
# gives you direct links to the websites
# to make your life a little easier
# i'd like to thank villain for helping
# me make it read multiple pages
#
# $Id: rip.pl,v 0.1 2006/07/06 01:41:00 retard Exp $

use strict;
use LWP::UserAgent;
use HTTP::Headers;
use Getopt::Long;

my ( $ip, $data, $output, $http, $i );
#my $options = { i => \$ip, o => \$output };
#GetOptions( $options, "i=s", "o:s" );

#&usage unless $ip;

my $currPage = 1;
my $found    = 0;
my $error    = 0;
my $numIds   = 0;
$output = "reverse.html" unless $output;

open(OUT, ">>list.out");

do {
	
        $http = LWP::UserAgent->new() or die;
        $http->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060321 Firefox/2.0a1");
        $data = $http->get("http://music.myspace.com/index.cfm?&fuseaction=music.directory&page=$currPage");

        if ( $data->is_success ) {
            my $html    = $data->content;
            my @matches = $html =~  /<td><a href="http:\/\/profile\.myspace\.com\/index\.cfm\?fuseaction=user\.viewprofile&friendID=(.*)">.*<\/a><\/td>/;
                

		foreach my $parse (@matches) {

                    if (@matches) {
			$numIds++;

                        print OUT "$parse\n";
                    }
}
}



           $currPage++ ;
	   print "$currPage $numIds\n\n";

} while ( $currPage <= 8705 );
close(OUT);

sub usage {
    print "whois.webhosting.info reverse ip parser\n";
    print "usage: perl $0 -io\n\n";
    print "  -i\t\tip to run a reverse ip lookup on\n";
    print "  -o\t\tfile to output the results to (default: reverse.html)\n";
    exit;
}