@@ 2144-2164 (lines=21) @@ | ||
2141 | """Get link to first comics.""" |
|
2142 | return get_soup_at_url(cls.url).find('img', attrs={'name': 'beginArrow'}).parent |
|
2143 | ||
2144 | @classmethod |
|
2145 | def get_navi_link(cls, last_soup, next_): |
|
2146 | """Get link to next or previous comic.""" |
|
2147 | return last_soup.find('img', attrs={'name': 'rightArrow' if next_ else 'leftArrow'}).parent |
|
2148 | ||
2149 | @classmethod |
|
2150 | def get_comic_info(cls, soup, link): |
|
2151 | """Get information about a particular comics.""" |
|
2152 | title = soup.find('meta', attrs={'name': 'twitter:title'})['content'] |
|
2153 | imgs = soup.find_all('meta', property='og:image') |
|
2154 | return { |
|
2155 | 'title': title, |
|
2156 | 'img': [i['content'] for i in imgs], |
|
2157 | } |
|
2158 | ||
2159 | ||
2160 | class TurnOffUs(GenericListableComic): |
|
2161 | """Class to retrieve TurnOffUs comics.""" |
|
2162 | name = 'turnoffus' |
|
2163 | long_name = 'Turn Off Us' |
|
2164 | url = 'http://turnoff.us' |
|
2165 | get_url_from_archive_element = join_cls_url_to_href |
|
2166 | ||
2167 | @classmethod |
|
@@ 2771-2788 (lines=18) @@ | ||
2768 | """Class to retrieve Buni Comics.""" |
|
2769 | name = 'buni' |
|
2770 | long_name = 'BuniComics' |
|
2771 | url = 'http://www.bunicomic.com' |
|
2772 | get_first_comic_link = get_a_comicnavbase_comicnavfirst |
|
2773 | get_navi_link = get_link_rel_next |
|
2774 | ||
2775 | @classmethod |
|
2776 | def get_comic_info(cls, soup, link): |
|
2777 | """Get information about a particular comics.""" |
|
2778 | imgs = soup.find('div', id='comic').find_all('img') |
|
2779 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2780 | assert len(imgs) == 1, imgs |
|
2781 | return { |
|
2782 | 'img': [i['src'] for i in imgs], |
|
2783 | 'title': imgs[0]['title'], |
|
2784 | } |
|
2785 | ||
2786 | ||
2787 | class GenericCommitStrip(GenericNavigableComic): |
|
2788 | """Generic class to retrieve Commit Strips in different languages.""" |
|
2789 | get_navi_link = get_a_rel_next |
|
2790 | get_first_comic_link = simulate_first_link |
|
2791 | first_url = NotImplemented |