@@ 2814-2844 (lines=31) @@ | ||
2811 | date_format = "%A, %d %B %Y" |
|
2812 | lang = "fr_FR.utf8" |
|
2813 | ||
2814 | ||
2815 | class UnearthedComics(GenericNavigableComic): |
|
2816 | """Class to retrieve Unearthed comics.""" |
|
2817 | # Also on http://tapastic.com/series/UnearthedComics |
|
2818 | # Also on http://unearthedcomics.tumblr.com |
|
2819 | name = 'unearthed' |
|
2820 | long_name = 'Unearthed Comics' |
|
2821 | url = 'http://unearthedcomics.com' |
|
2822 | _categories = ('UNEARTHED', ) |
|
2823 | get_navi_link = get_link_rel_next |
|
2824 | get_first_comic_link = simulate_first_link |
|
2825 | first_url = 'http://unearthedcomics.com/comics/world-with-turn-signals/' |
|
2826 | ||
2827 | @classmethod |
|
2828 | def get_comic_info(cls, soup, link): |
|
2829 | """Get information about a particular comics.""" |
|
2830 | short_url = soup.find('link', rel='shortlink')['href'] |
|
2831 | title_elt = soup.find('h1') or soup.find('h2') |
|
2832 | title = title_elt.string if title_elt else "" |
|
2833 | desc = soup.find('meta', property='og:description') |
|
2834 | date_str = soup.find('time', class_='published updated hidden')['datetime'] |
|
2835 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2836 | post = soup.find('div', class_="entry content entry-content type-portfolio") |
|
2837 | imgs = post.find_all('img') |
|
2838 | return { |
|
2839 | 'title': title, |
|
2840 | 'description': desc, |
|
2841 | 'url2': short_url, |
|
2842 | 'img': [i['src'] for i in imgs], |
|
2843 | 'month': day.month, |
|
2844 | 'year': day.year, |
|
2845 | 'day': day.day, |
|
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 |