YAFZ has asked for the wisdom of the Perl Monks concerning the following question:
Note: The working script can be viewed online at http://ileriseviye.org/cgi-bin/jazzparse.pl#!/usr/bin/perl -w use strict; use LWP::Simple; my %URL = ('jazztimes', 'http://jazztimes.com/JazzNews/JazzNews.asp', 'allaboutjazz', 'http://allaboutjazz.com'); my %pattern = ('jazztimes', '<a href="http://jazztimes\.com/JazzNews/J +azzNews\.asp\?cmd=view&articleid=\d+">[^<]+</a>', 'allaboutjazz', '/news/ft/2003.*?</a>'); my $data = get $URL{'jazztimes'}; print "Content-type: text/html\n\n"; print "JazzTimes.com:<br>"; while ($data =~ m!$pattern{'jazztimes'}!ig) { print "$&<br>"; } print "<br>"; print "allaboutjazz.com:<br>"; $data = get $URL{'allaboutjazz'}; while ($data =~ m!$pattern{'allaboutjazz'}!ig) { print "<a href=http://allaboutjazz.com" . "$&<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing for Jazz
by fglock (Vicar) on Jun 21, 2003 at 19:14 UTC | |
by YAFZ (Pilgrim) on Jun 21, 2003 at 23:37 UTC | |
|
Re: Parsing for Jazz
by Cody Pendant (Prior) on Jun 22, 2003 at 00:08 UTC | |
by YAFZ (Pilgrim) on Jun 22, 2003 at 01:13 UTC | |
by Cody Pendant (Prior) on Jun 23, 2003 at 02:07 UTC | |
by tilly (Archbishop) on Jun 23, 2003 at 08:25 UTC | |
by theorbtwo (Prior) on Jun 23, 2003 at 02:22 UTC | |
by YAFZ (Pilgrim) on Jun 23, 2003 at 10:16 UTC |