| 1 | package WWW::PDAScraper::SFGateWeird; | ||
| 2 | |||
| 3 | # PDAScraper.pm rules for scraping the | ||
| 4 | # Foo website | ||
| 5 | |||
| 6 | sub config { | ||
| 7 | return { | ||
| 8 | name => 'SF Gate Weird News', | ||
| 9 | # Name of the website. Arbitrary text. | ||
| 10 | |||
| 11 | start_from => 'http://www.sfgate.com/news/bondage/', | ||
| 12 | # URL where the scraper should find the links. | ||
| 13 | |||
| 14 | url_regex => [ '$', '&type=printable' ], | ||
| 15 | # This is the simple form of the url_regex, which | ||
| 16 | # is used to change a regular link to a "print-friendly" | ||
| 17 | # link. Simple because there are no backreferences | ||
| 18 | # neede on the RHS. | ||
| 19 | |||
| 20 | chunk_regex => qr{<FONT FACE="Geneva,Arial,sans-serif" SIZE="2"><B>(.*?)<TD WIDTH="15">}s | ||
| 21 | # A regular expression which returns your desired | ||
| 22 | # chunk of the page as $1. Using chunk_spec is better. | ||
| 23 | |||
| 24 | }; | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; |