@@ 471-500 (lines=30) @@ | ||
468 | first_url = "http://uneanneeaulycee.blog.lemonde.fr/2016/06/13/la-semaine-du-bac-est-arrivee/" |
|
469 | ||
470 | ||
471 | class Rall(GenericNavigableComic): |
|
472 | """Class to retrieve Ted Rall comics.""" |
|
473 | # Also on http://www.gocomics.com/tedrall |
|
474 | name = 'rall' |
|
475 | long_name = "Ted Rall" |
|
476 | url = "http://rall.com/comic" |
|
477 | _categories = ('RALL', ) |
|
478 | get_navi_link = get_link_rel_next |
|
479 | get_first_comic_link = simulate_first_link |
|
480 | # Not the first but I didn't find an efficient way to retrieve it |
|
481 | first_url = "http://rall.com/2014/01/30/los-angeles-times-cartoon-well-miss-those-california-flowers" |
|
482 | ||
483 | @classmethod |
|
484 | def get_comic_info(cls, soup, link): |
|
485 | """Get information about a particular comics.""" |
|
486 | title = soup.find('meta', property='og:title')['content'] |
|
487 | author = soup.find("span", class_="author vcard").find("a").string |
|
488 | date_str = soup.find("span", class_="entry-date").string |
|
489 | day = string_to_date(date_str, "%B %d, %Y") |
|
490 | desc = soup.find('meta', property='og:description')['content'] |
|
491 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
492 | imgs = imgs[:-7] # remove social media buttons |
|
493 | return { |
|
494 | 'title': title, |
|
495 | 'author': author, |
|
496 | 'month': day.month, |
|
497 | 'year': day.year, |
|
498 | 'day': day.day, |
|
499 | 'description': desc, |
|
500 | 'img': [i['src'] for i in imgs], |
|
501 | } |
|
502 | ||
503 | ||
@@ 2786-2816 (lines=31) @@ | ||
2783 | lang = "fr_FR.utf8" |
|
2784 | ||
2785 | ||
2786 | class UnearthedComics(GenericNavigableComic): |
|
2787 | """Class to retrieve Unearthed comics.""" |
|
2788 | # Also on http://tapastic.com/series/UnearthedComics |
|
2789 | # Also on http://unearthedcomics.tumblr.com |
|
2790 | name = 'unearthed' |
|
2791 | long_name = 'Unearthed Comics' |
|
2792 | url = 'http://unearthedcomics.com' |
|
2793 | _categories = ('UNEARTHED', ) |
|
2794 | get_navi_link = get_link_rel_next |
|
2795 | get_first_comic_link = simulate_first_link |
|
2796 | first_url = 'http://unearthedcomics.com/comics/world-with-turn-signals/' |
|
2797 | ||
2798 | @classmethod |
|
2799 | def get_comic_info(cls, soup, link): |
|
2800 | """Get information about a particular comics.""" |
|
2801 | short_url = soup.find('link', rel='shortlink')['href'] |
|
2802 | title_elt = soup.find('h1') or soup.find('h2') |
|
2803 | title = title_elt.string if title_elt else "" |
|
2804 | desc = soup.find('meta', property='og:description') |
|
2805 | date_str = soup.find('time', class_='published updated hidden')['datetime'] |
|
2806 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2807 | post = soup.find('div', class_="entry content entry-content type-portfolio") |
|
2808 | imgs = post.find_all('img') |
|
2809 | return { |
|
2810 | 'title': title, |
|
2811 | 'description': desc, |
|
2812 | 'url2': short_url, |
|
2813 | 'img': [i['src'] for i in imgs], |
|
2814 | 'month': day.month, |
|
2815 | 'year': day.year, |
|
2816 | 'day': day.day, |
|
2817 | } |
|
2818 | ||
2819 |