@@ 2981-2993 (lines=13) @@ | ||
2978 | """Get link to first comics.""" |
|
2979 | return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link') |
|
2980 | ||
2981 | @classmethod |
|
2982 | def get_comic_info(cls, soup, link): |
|
2983 | """Get information about a particular comics.""" |
|
2984 | title = soup.find('meta', property='og:title')['content'] |
|
2985 | imgs = soup.find('div', class_='webcomic-image').find_all('img') |
|
2986 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
2987 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2988 | return { |
|
2989 | 'title': title, |
|
2990 | 'day': day.day, |
|
2991 | 'month': day.month, |
|
2992 | 'year': day.year, |
|
2993 | 'img': [i['src'] for i in imgs], |
|
2994 | } |
|
2995 | ||
2996 | ||
@@ 2674-2685 (lines=12) @@ | ||
2671 | """Generic class to retrieve Commit Strips in different languages.""" |
|
2672 | get_navi_link = get_a_rel_next |
|
2673 | ||
2674 | @classmethod |
|
2675 | def get_comic_info(cls, soup, link): |
|
2676 | """Get information about a particular comics.""" |
|
2677 | desc = soup.find('meta', property='og:description')['content'] |
|
2678 | title = soup.find('meta', property='og:title')['content'] |
|
2679 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
2680 | title2 = ' '.join(i.get('title', '') for i in imgs) |
|
2681 | return { |
|
2682 | 'title': title, |
|
2683 | 'title2': title2, |
|
2684 | 'description': desc, |
|
2685 | 'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
|
2686 | } |
|
2687 | ||
2688 |