I frequently write down a telephonenumber and then forget to write down the name of the owner. It must have something to do with my brilliant sense of organisation <*coughs*>.

Anyway you used to have a program named Foongrep where you could search on dutch telephonenumbers, but sadly it has been discontinued (after a legal battle) for a long time now. I came upon a site that still offers this service, so I wrote this small commandline program. I learned much from Juerd's vandale.pl, that checks words in the dutch dictionairy.

#!/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 ) )->c +ontent; #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-123 +4567\n"; exit; }

In reply to Poor man's Foongrep for dutch telephonenumbers by teabag

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.