| 1 | #! perl | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | package Comics::Plugin::PBFComics; | ||
| 7 | |||
| 8 | use parent qw(Comics::Fetcher::Single); | ||
| 9 | |||
| 10 | our $VERSION = "1.01"; | ||
| 11 | |||
| 12 | our $name = "The Perry Bible Fellowship"; | ||
| 13 | our $url = "https://pbfcomics.com/"; | ||
| 14 | |||
| 15 | # <div id="comic"><img src='http://pbfcomics.com/wp-content/uploads/2017/09/PBF280-Technorgy.png' width='750' height='1070' alt='' title='Technorgy' /></div> | ||
| 16 | |||
| 17 | our $pattern = | ||
| 18 | qr{ <div \s+ id="comic"> | ||
| 19 | <img \s+ | ||
| 20 | width = '\d+' \s+ | ||
| 21 | height = '\d+' \s+ | ||
| 22 | alt = '(?<alt>.*?)' \s+ | ||
| 23 | title = '(?<title>.*?)' \s+ | ||
| 24 | data-src= ['"](?<url>https?://pbfcomics.com/wp-content/uploads/ | ||
| 25 | \d+ / \d+ / | ||
| 26 | (?<image>.+?\.\w+))['"] | ||
| 27 | }x; | ||
| 28 | |||
| 29 | # Important: Return the package name! | ||
| 30 | __PACKAGE__; |