|
@@ 2814-2844 (lines=31) @@
|
| 2811 |
|
lang = "fr_FR.utf8" |
| 2812 |
|
|
| 2813 |
|
|
| 2814 |
|
class UnearthedComics(GenericNavigableComic): |
| 2815 |
|
"""Class to retrieve Unearthed comics.""" |
| 2816 |
|
# Also on http://tapastic.com/series/UnearthedComics |
| 2817 |
|
# Also on http://unearthedcomics.tumblr.com |
| 2818 |
|
name = 'unearthed' |
| 2819 |
|
long_name = 'Unearthed Comics' |
| 2820 |
|
url = 'http://unearthedcomics.com' |
| 2821 |
|
_categories = ('UNEARTHED', ) |
| 2822 |
|
get_navi_link = get_link_rel_next |
| 2823 |
|
get_first_comic_link = simulate_first_link |
| 2824 |
|
first_url = 'http://unearthedcomics.com/comics/world-with-turn-signals/' |
| 2825 |
|
|
| 2826 |
|
@classmethod |
| 2827 |
|
def get_comic_info(cls, soup, link): |
| 2828 |
|
"""Get information about a particular comics.""" |
| 2829 |
|
short_url = soup.find('link', rel='shortlink')['href'] |
| 2830 |
|
title_elt = soup.find('h1') or soup.find('h2') |
| 2831 |
|
title = title_elt.string if title_elt else "" |
| 2832 |
|
desc = soup.find('meta', property='og:description') |
| 2833 |
|
date_str = soup.find('time', class_='published updated hidden')['datetime'] |
| 2834 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 2835 |
|
post = soup.find('div', class_="entry content entry-content type-portfolio") |
| 2836 |
|
imgs = post.find_all('img') |
| 2837 |
|
return { |
| 2838 |
|
'title': title, |
| 2839 |
|
'description': desc, |
| 2840 |
|
'url2': short_url, |
| 2841 |
|
'img': [i['src'] for i in imgs], |
| 2842 |
|
'month': day.month, |
| 2843 |
|
'year': day.year, |
| 2844 |
|
'day': day.day, |
| 2845 |
|
} |
| 2846 |
|
|
| 2847 |
|
|
|
@@ 473-502 (lines=30) @@
|
| 470 |
|
first_url = "http://uneanneeaulycee.blog.lemonde.fr/2016/06/13/la-semaine-du-bac-est-arrivee/" |
| 471 |
|
|
| 472 |
|
|
| 473 |
|
class Rall(GenericNavigableComic): |
| 474 |
|
"""Class to retrieve Ted Rall comics.""" |
| 475 |
|
# Also on http://www.gocomics.com/tedrall |
| 476 |
|
name = 'rall' |
| 477 |
|
long_name = "Ted Rall" |
| 478 |
|
url = "http://rall.com/comic" |
| 479 |
|
_categories = ('RALL', ) |
| 480 |
|
get_navi_link = get_link_rel_next |
| 481 |
|
get_first_comic_link = simulate_first_link |
| 482 |
|
# Not the first but I didn't find an efficient way to retrieve it |
| 483 |
|
first_url = "http://rall.com/2014/01/30/los-angeles-times-cartoon-well-miss-those-california-flowers" |
| 484 |
|
|
| 485 |
|
@classmethod |
| 486 |
|
def get_comic_info(cls, soup, link): |
| 487 |
|
"""Get information about a particular comics.""" |
| 488 |
|
title = soup.find('meta', property='og:title')['content'] |
| 489 |
|
author = soup.find("span", class_="author vcard").find("a").string |
| 490 |
|
date_str = soup.find("span", class_="entry-date").string |
| 491 |
|
day = string_to_date(date_str, "%B %d, %Y") |
| 492 |
|
desc = soup.find('meta', property='og:description')['content'] |
| 493 |
|
imgs = soup.find('div', class_='entry-content').find_all('img') |
| 494 |
|
imgs = imgs[:-7] # remove social media buttons |
| 495 |
|
return { |
| 496 |
|
'title': title, |
| 497 |
|
'author': author, |
| 498 |
|
'month': day.month, |
| 499 |
|
'year': day.year, |
| 500 |
|
'day': day.day, |
| 501 |
|
'description': desc, |
| 502 |
|
'img': [i['src'] for i in imgs], |
| 503 |
|
} |
| 504 |
|
|
| 505 |
|
|