#!/usr/bin/perl -w #gettel.pl - poor man's foongrep for dutch telephone numbers use strict; use LWP::UserAgent; my $nummer; if ( $ARGV[0] ) { $nummer = $ARGV[0]; } else { Jammer_hoor(); } if ( $nummer !~ m/\b\d{3}-\d{7}\b/ ) { Jammer_hoor(); } #get page my $url = "http://zoekopnummer.ath.cx/index.php?nummer=$nummer"; my $info = LWP::UserAgent->new->request( HTTP::Request->new( GET => $url ) )->content; #no more newlines! $info =~ s/\n//g; #substitute number $nummer =~ s/-//gi; if ( $info !~ m/Naam:/g ) { print "\nNo info found on that number\n"; exit; } #filter out all the adds and links $info =~ s/$nummer//gi; $info =~ s/<.*?>//gi; $info =~ s/\.\.\..*?\.\.\.//gi; $info =~ s/\{.*?\}//gi; $info =~ s/\(.*?\)//gi; $info =~ s/table.*?://gi; $info =~ s/1\ item.*?sp\;//gi; $info =~ s/2\ item.*?sp\;//gi; $info =~ s/\s+/ /gi; #format for easy cut 'n paste $info =~ s/Telnr: /\n/g; $info =~ s/Naam: /\n/g; $info =~ s/Adres: /\n/g; $info =~ s/Plaats: /\n/g; $info =~ s/Postcode: /\n/g; $info =~ s/Fax: /\nfax: /g; print "$info"; sub Jammer_hoor { print "Usage: Specify a dutch telephone number like\ngettel.pl 020-1234567\n"; exit; }