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