Code Duplication    Length = 18-21 lines in 2 locations

comics.py 2 locations

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