| 1 | package WWW::PDAScraper::Yahoo::Science::WeatherNews; | ||
| 2 | |||
| 3 | # PDAScraper.pm rules for scraping the | ||
| 4 | # Yahoo Science WeatherNews page | ||
| 5 | |||
| 6 | sub config { | ||
| 7 | return { | ||
| 8 | name => 'Yahoo Science WeatherNews', | ||
| 9 | start_from => 'http://news.yahoo.com/i/1112', | ||
| 10 | chunk_spec => [ "_tag", "div", "id", "indexstories" ], | ||
| 11 | url_regex => [ '$', '&printer=1' ], | ||
| 12 | link_spec => [sub { $_[0]->attr('href') =~ m|^/s| }] | ||
| 13 | # Yahoo's actual stories are in a "/s/" directory. | ||
| 14 | # making it easy to eliminate photos, javascript, | ||
| 15 | # external links, etc. | ||
| 16 | }; | ||
| 17 | } | ||
| 18 | |||
| 19 | 1; |