@@ 2874-2904 (lines=31) @@ | ||
2871 | lang = "fr_FR.utf8" |
|
2872 | ||
2873 | ||
2874 | class UnearthedComics(GenericNavigableComic): |
|
2875 | """Class to retrieve Unearthed comics.""" |
|
2876 | # Also on http://tapastic.com/series/UnearthedComics |
|
2877 | # Also on https://unearthedcomics.tumblr.com |
|
2878 | name = 'unearthed' |
|
2879 | long_name = 'Unearthed Comics' |
|
2880 | url = 'http://unearthedcomics.com' |
|
2881 | _categories = ('UNEARTHED', ) |
|
2882 | get_navi_link = get_link_rel_next |
|
2883 | get_first_comic_link = simulate_first_link |
|
2884 | first_url = 'http://unearthedcomics.com/comics/world-with-turn-signals/' |
|
2885 | ||
2886 | @classmethod |
|
2887 | def get_comic_info(cls, soup, link): |
|
2888 | """Get information about a particular comics.""" |
|
2889 | short_url = soup.find('link', rel='shortlink')['href'] |
|
2890 | title_elt = soup.find('h1') or soup.find('h2') |
|
2891 | title = title_elt.string if title_elt else "" |
|
2892 | desc = soup.find('meta', property='og:description') |
|
2893 | date_str = soup.find('time', class_='published updated hidden')['datetime'] |
|
2894 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2895 | post = soup.find('div', class_="entry content entry-content type-portfolio") |
|
2896 | imgs = post.find_all('img') |
|
2897 | return { |
|
2898 | 'title': title, |
|
2899 | 'description': desc, |
|
2900 | 'url2': short_url, |
|
2901 | 'img': [i['src'] for i in imgs], |
|
2902 | 'month': day.month, |
|
2903 | 'year': day.year, |
|
2904 | 'day': day.day, |
|
2905 | } |
|
2906 | ||
2907 | ||
@@ 524-553 (lines=30) @@ | ||
521 | first_url = "http://uneanneeaulycee.blog.lemonde.fr/2016/06/13/la-semaine-du-bac-est-arrivee/" |
|
522 | ||
523 | ||
524 | class Rall(GenericComicNotWorking, GenericNavigableComic): |
|
525 | """Class to retrieve Ted Rall comics.""" |
|
526 | # Also on http://www.gocomics.com/tedrall |
|
527 | name = 'rall' |
|
528 | long_name = "Ted Rall" |
|
529 | url = "http://rall.com/comic" |
|
530 | _categories = ('RALL', ) |
|
531 | get_navi_link = get_link_rel_next |
|
532 | get_first_comic_link = simulate_first_link |
|
533 | # Not the first but I didn't find an efficient way to retrieve it |
|
534 | first_url = "http://rall.com/2014/01/30/los-angeles-times-cartoon-well-miss-those-california-flowers" |
|
535 | ||
536 | @classmethod |
|
537 | def get_comic_info(cls, soup, link): |
|
538 | """Get information about a particular comics.""" |
|
539 | title = soup.find('meta', property='og:title')['content'] |
|
540 | author = soup.find("span", class_="author vcard").find("a").string |
|
541 | date_str = soup.find("span", class_="entry-date").string |
|
542 | day = string_to_date(date_str, "%B %d, %Y") |
|
543 | desc = soup.find('meta', property='og:description')['content'] |
|
544 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
545 | imgs = imgs[:-7] # remove social media buttons |
|
546 | return { |
|
547 | 'title': title, |
|
548 | 'author': author, |
|
549 | 'month': day.month, |
|
550 | 'year': day.year, |
|
551 | 'day': day.day, |
|
552 | 'description': desc, |
|
553 | 'img': [i['src'] for i in imgs], |
|
554 | } |
|
555 | ||
556 |