|
@@ 1748-1777 (lines=30) @@
|
| 1745 |
|
} |
| 1746 |
|
|
| 1747 |
|
|
| 1748 |
|
class RespawnComic(GenericNavigableComic): |
| 1749 |
|
"""Class to retrieve Respawn Comic.""" |
| 1750 |
|
# Also on http://respawncomic.tumblr.com |
| 1751 |
|
name = 'respawn' |
| 1752 |
|
long_name = 'Respawn Comic' |
| 1753 |
|
url = 'http://respawncomic.com ' |
| 1754 |
|
get_navi_link = get_a_rel_next |
| 1755 |
|
get_first_comic_link = simulate_first_link |
| 1756 |
|
first_url = 'http://respawncomic.com/comic/c0001/' |
| 1757 |
|
|
| 1758 |
|
@classmethod |
| 1759 |
|
def get_comic_info(cls, soup, link): |
| 1760 |
|
"""Get information about a particular comics.""" |
| 1761 |
|
title = soup.find('meta', property='og:title')['content'] |
| 1762 |
|
author = soup.find('meta', attrs={'name': 'shareaholic:article_author_name'})['content'] |
| 1763 |
|
date_str = soup.find('meta', attrs={'name': 'shareaholic:article_published_time'})['content'] |
| 1764 |
|
date_str = date_str[:10] |
| 1765 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 1766 |
|
imgs = soup.find_all('meta', property='og:image') |
| 1767 |
|
skip_imgs = { |
| 1768 |
|
'http://respawncomic.com/wp-content/uploads/2016/03/site/HAROLD2.png', |
| 1769 |
|
'http://respawncomic.com/wp-content/uploads/2016/03/site/DEVA.png' |
| 1770 |
|
} |
| 1771 |
|
return { |
| 1772 |
|
'title': title, |
| 1773 |
|
'author': author, |
| 1774 |
|
'day': day.day, |
| 1775 |
|
'month': day.month, |
| 1776 |
|
'year': day.year, |
| 1777 |
|
'img': [i['content'] for i in imgs if i['content'] not in skip_imgs], |
| 1778 |
|
} |
| 1779 |
|
|
| 1780 |
|
|
|
@@ 485-516 (lines=32) @@
|
| 482 |
|
} |
| 483 |
|
|
| 484 |
|
|
| 485 |
|
class Dilem(GenericNavigableComic): |
| 486 |
|
"""Class to retrieve Ali Dilem comics.""" |
| 487 |
|
name = 'dilem' |
| 488 |
|
long_name = 'Ali Dilem' |
| 489 |
|
url = 'http://information.tv5monde.com/dilem' |
| 490 |
|
get_url_from_link = join_cls_url_to_href |
| 491 |
|
get_first_comic_link = simulate_first_link |
| 492 |
|
first_url = "http://information.tv5monde.com/dilem/2004-06-26" |
| 493 |
|
|
| 494 |
|
@classmethod |
| 495 |
|
def get_navi_link(cls, last_soup, next_): |
| 496 |
|
"""Get link to next or previous comic.""" |
| 497 |
|
# prev is next / next is prev |
| 498 |
|
li = last_soup.find('li', class_='prev' if next_ else 'next') |
| 499 |
|
return li.find('a') if li else None |
| 500 |
|
|
| 501 |
|
@classmethod |
| 502 |
|
def get_comic_info(cls, soup, link): |
| 503 |
|
"""Get information about a particular comics.""" |
| 504 |
|
short_url = soup.find('link', rel='shortlink')['href'] |
| 505 |
|
title = soup.find('meta', attrs={'name': 'twitter:title'})['content'] |
| 506 |
|
imgs = soup.find_all('meta', property='og:image') |
| 507 |
|
date_str = soup.find('span', property='dc:date')['content'] |
| 508 |
|
date_str = date_str[:10] |
| 509 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 510 |
|
return { |
| 511 |
|
'short_url': short_url, |
| 512 |
|
'title': title, |
| 513 |
|
'img': [i['content'] for i in imgs], |
| 514 |
|
'day': day.day, |
| 515 |
|
'month': day.month, |
| 516 |
|
'year': day.year, |
| 517 |
|
} |
| 518 |
|
|
| 519 |
|
|
|
@@ 994-1021 (lines=28) @@
|
| 991 |
|
} |
| 992 |
|
|
| 993 |
|
|
| 994 |
|
class Mercworks(GenericNavigableComic): |
| 995 |
|
"""Class to retrieve Mercworks comics.""" |
| 996 |
|
# Also on http://mercworks.tumblr.com |
| 997 |
|
name = 'mercworks' |
| 998 |
|
long_name = 'Mercworks' |
| 999 |
|
url = 'http://mercworks.net' |
| 1000 |
|
get_first_comic_link = get_a_comicnavbase_comicnavfirst |
| 1001 |
|
get_navi_link = get_a_rel_next |
| 1002 |
|
|
| 1003 |
|
@classmethod |
| 1004 |
|
def get_comic_info(cls, soup, link): |
| 1005 |
|
"""Get information about a particular comics.""" |
| 1006 |
|
title = soup.find('meta', property='og:title')['content'] |
| 1007 |
|
metadesc = soup.find('meta', property='og:description') |
| 1008 |
|
desc = metadesc['content'] if metadesc else "" |
| 1009 |
|
author = soup.find('meta', attrs={'name': 'shareaholic:article_author_name'})['content'] |
| 1010 |
|
date_str = soup.find('meta', attrs={'name': 'shareaholic:article_published_time'})['content'] |
| 1011 |
|
date_str = date_str[:10] |
| 1012 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 1013 |
|
imgs = soup.find_all('meta', property='og:image') |
| 1014 |
|
return { |
| 1015 |
|
'img': [i['content'] for i in imgs], |
| 1016 |
|
'title': title, |
| 1017 |
|
'author': author, |
| 1018 |
|
'desc': desc, |
| 1019 |
|
'day': day.day, |
| 1020 |
|
'month': day.month, |
| 1021 |
|
'year': day.year |
| 1022 |
|
} |
| 1023 |
|
|
| 1024 |
|
|