@@ 2193-2213 (lines=21) @@ | ||
2190 | } |
|
2191 | ||
2192 | ||
2193 | class TurnOffUs(GenericListableComic): |
|
2194 | """Class to retrieve TurnOffUs comics.""" |
|
2195 | name = 'turnoffus' |
|
2196 | long_name = 'Turn Off Us' |
|
2197 | url = 'http://turnoff.us' |
|
2198 | get_url_from_archive_element = join_cls_url_to_href |
|
2199 | ||
2200 | @classmethod |
|
2201 | def get_archive_elements(cls): |
|
2202 | archive_url = urljoin_wrapper(cls.url, 'all') |
|
2203 | post_list = get_soup_at_url(archive_url).find('ul', class_='post-list') |
|
2204 | return reversed(post_list.find_all('a', class_='post-link')) |
|
2205 | ||
2206 | @classmethod |
|
2207 | def get_comic_info(cls, soup, archive_elt): |
|
2208 | """Get information about a particular comics.""" |
|
2209 | title = soup.find('meta', property='og:title')['content'] |
|
2210 | imgs = soup.find_all('meta', property='og:image') |
|
2211 | return { |
|
2212 | 'title': title, |
|
2213 | 'img': [i['content'] for i in imgs], |
|
2214 | } |
|
2215 | ||
2216 | ||
@@ 2820-2837 (lines=18) @@ | ||
2817 | } |
|
2818 | ||
2819 | ||
2820 | class GenericCommitStrip(GenericNavigableComic): |
|
2821 | """Generic class to retrieve Commit Strips in different languages.""" |
|
2822 | get_navi_link = get_a_rel_next |
|
2823 | get_first_comic_link = simulate_first_link |
|
2824 | first_url = NotImplemented |
|
2825 | ||
2826 | @classmethod |
|
2827 | def get_comic_info(cls, soup, link): |
|
2828 | """Get information about a particular comics.""" |
|
2829 | desc = soup.find('meta', property='og:description')['content'] |
|
2830 | title = soup.find('meta', property='og:title')['content'] |
|
2831 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
2832 | title2 = ' '.join(i.get('title', '') for i in imgs) |
|
2833 | return { |
|
2834 | 'title': title, |
|
2835 | 'title2': title2, |
|
2836 | 'description': desc, |
|
2837 | 'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
|
2838 | } |
|
2839 | ||
2840 |