| 1 | #! perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | package Comics::Plugin::RedMeat; | ||
| 7 | |||
| 8 | use parent qw(Comics::Fetcher::Single); | ||
| 9 | |||
| 10 | our $VERSION = "1.00"; | ||
| 11 | |||
| 12 | our $name = "Red Meat"; | ||
| 13 | our $url = "http://redmeat.com/max-cannon/FreshMeat/"; | ||
| 14 | our $pattern = | ||
| 15 | qr{ <meta \s+ | ||
| 16 | name="description" \s+ | ||
| 17 | content="(?<title>.*?)" \s* /> | ||
| 18 | .*? | ||
| 19 | <div \s+ class="comicStrip"> \s+ | ||
| 20 | <a \s+ | ||
| 21 | href="https?://www.redmeat.com/max-cannon/.*?"> \s* | ||
| 22 | <img \s+ | ||
| 23 | src="(?<url>https?://.*?\.fdncms\.com/ | ||
| 24 | redmeat/imager/u/redmeat/ | ||
| 25 | \d+/(?<image>.*?\.\w+))" \s+ | ||
| 26 | width="\d+" \s+ height="\d+" \s+ | ||
| 27 | alt="(?<alt>.*?)" \s* | ||
| 28 | /> \s* </a> \s* | ||
| 29 | </div> | ||
| 30 | }sx; | ||
| 31 | |||
| 32 | # Important: Return the package name! | ||
| 33 | __PACKAGE__; |