3 binmode(STDOUT, ":utf8");
13 $ua = LWP::UserAgent->new;
14 $ua->agent("tel2name/1.0 ");
15 $res = $ua->request(HTTP::Request->new("GET", "http://www.eniro.se/query?what=yp&search_word=$tel"));
17 return undef unless $res->is_success;
19 $html = $res->content;
21 match: while($html =~ /<span\s+class\s*=\s*"org fn"\s*>\s*([^<]*[^\s<])\s*<\/span>/ig) {
22 $match = decode_entities($1);
23 for $prev (@matches) {
24 next match if $prev eq $match;
26 push @matches, $match;
28 for $match (@matches) {
37 $ua = LWP::UserAgent->new;
38 $ua->agent("tel2name/1.0 ");
39 $res = $ua->request(HTTP::Request->new("GET", "http://www.eniro.se/query?what=wp&phone_number=$tel"));
41 return undef unless $res->is_success;
43 $html = $res->content;
45 match: while($html =~ /<a\s+class\s*=\s*"fn expand"[^>]*>\s*\<span\>\s*([^<]*[^\s<])\s*<\/span>/ig) {
46 $match = decode_entities($1);
47 for $prev (@matches) {
48 next match if $prev eq $match;
50 push @matches, $match;
52 for $match (@matches) {
59 if(open NT, $ENV{"HOME"} . "/phone/nametab") {
69 $yppid = open YP, "-|";
74 $wppid = open WP, "-|";
84 for $prev (@matches) {
85 next match if $prev eq $_;
91 for $prev (@matches) {
92 next match if $prev eq $_;
97 for $match (@matches) {