|
@@ 4312-4328 (lines=17) @@
|
| 4309 |
|
class RockPaperCynicTumblr(GenericTumblrV1): |
| 4310 |
|
"""Class to retrieve RockPaperCynic comics.""" |
| 4311 |
|
# Also on http://www.rockpapercynic.com |
| 4312 |
|
# Also on https://tapastic.com/series/rockpapercynic |
| 4313 |
|
name = 'rpc-tumblr' |
| 4314 |
|
long_name = 'Rock Paper Cynic (from Tumblr)' |
| 4315 |
|
url = 'http://rockpapercynic.tumblr.com' |
| 4316 |
|
|
| 4317 |
|
|
| 4318 |
|
class DeadlyPanelTumblr(GenericTumblrV1): |
| 4319 |
|
"""Class to retrieve Deadly Panel comics.""" |
| 4320 |
|
# Also on http://www.deadlypanel.com |
| 4321 |
|
# Also on https://tapastic.com/series/deadlypanel |
| 4322 |
|
name = 'deadly-tumblr' |
| 4323 |
|
long_name = 'Deadly Panel (from Tumblr)' |
| 4324 |
|
url = 'http://deadlypanel.tumblr.com' |
| 4325 |
|
|
| 4326 |
|
|
| 4327 |
|
class CatanaComics(GenericTumblrV1): |
| 4328 |
|
"""Class to retrieve Catana comics.""" |
| 4329 |
|
name = 'catana' |
| 4330 |
|
long_name = 'Catana' |
| 4331 |
|
url = 'http://www.catanacomics.com' |
|
@@ 730-745 (lines=16) @@
|
| 727 |
|
get_navi_link = get_link_rel_next |
| 728 |
|
get_url_from_link = join_cls_url_to_href |
| 729 |
|
|
| 730 |
|
@classmethod |
| 731 |
|
def get_comic_info(cls, soup, link): |
| 732 |
|
"""Get information about a particular comics.""" |
| 733 |
|
short_url_re = re.compile('^%s/\\?p=([0-9]*)' % cls.url) |
| 734 |
|
short_url = cls.get_url_from_link(soup.find('link', rel='shortlink')) |
| 735 |
|
num = int(short_url_re.match(short_url).groups()[0]) |
| 736 |
|
imgs = soup.find('div', id='comic').find_all('img') |
| 737 |
|
assert len(imgs) == 1 |
| 738 |
|
title = imgs[0]['alt'] |
| 739 |
|
title2 = imgs[0]['title'] |
| 740 |
|
return { |
| 741 |
|
'short_url': short_url, |
| 742 |
|
'title': title, |
| 743 |
|
'title2': title2, |
| 744 |
|
'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs], |
| 745 |
|
'num': num, |
| 746 |
|
} |
| 747 |
|
|
| 748 |
|
|