@@ 2197-2217 (lines=21) @@ | ||
2194 | class TurnOffUs(GenericListableComic): |
|
2195 | """Class to retrieve TurnOffUs comics.""" |
|
2196 | name = 'turnoffus' |
|
2197 | long_name = 'Turn Off Us' |
|
2198 | url = 'http://turnoff.us' |
|
2199 | get_url_from_archive_element = join_cls_url_to_href |
|
2200 | ||
2201 | @classmethod |
|
2202 | def get_archive_elements(cls): |
|
2203 | archive_url = urljoin_wrapper(cls.url, 'all') |
|
2204 | post_list = get_soup_at_url(archive_url).find('ul', class_='post-list') |
|
2205 | return reversed(post_list.find_all('a', class_='post-link')) |
|
2206 | ||
2207 | @classmethod |
|
2208 | def get_comic_info(cls, soup, archive_elt): |
|
2209 | """Get information about a particular comics.""" |
|
2210 | title = soup.find('meta', property='og:title')['content'] |
|
2211 | imgs = soup.find_all('meta', property='og:image') |
|
2212 | return { |
|
2213 | 'title': title, |
|
2214 | 'img': [i['content'] for i in imgs], |
|
2215 | } |
|
2216 | ||
2217 | ||
2218 | class ThingsInSquares(GenericListableComic): |
|
2219 | """Class to retrieve Things In Squares comics.""" |
|
2220 | # This can be retrieved in other languages |
|
@@ 2857-2874 (lines=18) @@ | ||
2854 | return { |
|
2855 | 'title': title, |
|
2856 | 'img': [i['src'] for i in imgs], |
|
2857 | 'month': day.month, |
|
2858 | 'year': day.year, |
|
2859 | 'day': day.day, |
|
2860 | } |
|
2861 | ||
2862 | ||
2863 | class BuniComic(GenericNavigableComic): |
|
2864 | """Class to retrieve Buni Comics.""" |
|
2865 | name = 'buni' |
|
2866 | long_name = 'BuniComics' |
|
2867 | url = 'http://www.bunicomic.com' |
|
2868 | get_first_comic_link = get_a_comicnavbase_comicnavfirst |
|
2869 | get_navi_link = get_link_rel_next |
|
2870 | ||
2871 | @classmethod |
|
2872 | def get_comic_info(cls, soup, link): |
|
2873 | """Get information about a particular comics.""" |
|
2874 | imgs = soup.find('div', id='comic').find_all('img') |
|
2875 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2876 | assert len(imgs) == 1, imgs |
|
2877 | return { |