@@ 2148-2168 (lines=21) @@ | ||
2145 | 'title': title, |
|
2146 | 'img': [i['content'] for i in imgs], |
|
2147 | } |
|
2148 | ||
2149 | ||
2150 | class TurnOffUs(GenericListableComic): |
|
2151 | """Class to retrieve TurnOffUs comics.""" |
|
2152 | name = 'turnoffus' |
|
2153 | long_name = 'Turn Off Us' |
|
2154 | url = 'http://turnoff.us' |
|
2155 | get_url_from_archive_element = join_cls_url_to_href |
|
2156 | ||
2157 | @classmethod |
|
2158 | def get_archive_elements(cls): |
|
2159 | archive_url = urljoin_wrapper(cls.url, 'all') |
|
2160 | post_list = get_soup_at_url(archive_url).find('ul', class_='post-list') |
|
2161 | return reversed(post_list.find_all('a', class_='post-link')) |
|
2162 | ||
2163 | @classmethod |
|
2164 | def get_comic_info(cls, soup, archive_elt): |
|
2165 | """Get information about a particular comics.""" |
|
2166 | title = soup.find('meta', property='og:title')['content'] |
|
2167 | imgs = soup.find_all('meta', property='og:image') |
|
2168 | return { |
|
2169 | 'title': title, |
|
2170 | 'img': [i['content'] for i in imgs], |
|
2171 | } |
|
@@ 2748-2765 (lines=18) @@ | ||
2745 | title = soup.find('h2', class_='post-title').string |
|
2746 | date_str = soup.find("span", class_="post-date").string |
|
2747 | day = string_to_date(date_str, "%B %d, %Y") |
|
2748 | imgs = soup.find('div', id='comic').find_all('img') |
|
2749 | return { |
|
2750 | 'title': title, |
|
2751 | 'img': [i['src'] for i in imgs], |
|
2752 | 'month': day.month, |
|
2753 | 'year': day.year, |
|
2754 | 'day': day.day, |
|
2755 | } |
|
2756 | ||
2757 | ||
2758 | class BuniComic(GenericNavigableComic): |
|
2759 | """Class to retrieve Buni Comics.""" |
|
2760 | name = 'buni' |
|
2761 | long_name = 'BuniComics' |
|
2762 | url = 'http://www.bunicomic.com' |
|
2763 | get_first_comic_link = get_a_comicnavbase_comicnavfirst |
|
2764 | get_navi_link = get_link_rel_next |
|
2765 | ||
2766 | @classmethod |
|
2767 | def get_comic_info(cls, soup, link): |
|
2768 | """Get information about a particular comics.""" |