Code Duplication    Length = 18-21 lines in 2 locations

comics.py 2 locations

@@ 2197-2217 (lines=21) @@
2194
        }
2195
2196
2197
class TurnOffUs(GenericListableComic):
2198
    """Class to retrieve TurnOffUs comics."""
2199
    name = 'turnoffus'
2200
    long_name = 'Turn Off Us'
2201
    url = 'http://turnoff.us'
2202
    get_url_from_archive_element = join_cls_url_to_href
2203
2204
    @classmethod
2205
    def get_archive_elements(cls):
2206
        archive_url = urljoin_wrapper(cls.url, 'all')
2207
        post_list = get_soup_at_url(archive_url).find('ul', class_='post-list')
2208
        return reversed(post_list.find_all('a', class_='post-link'))
2209
2210
    @classmethod
2211
    def get_comic_info(cls, soup, archive_elt):
2212
        """Get information about a particular comics."""
2213
        title = soup.find('meta', property='og:title')['content']
2214
        imgs = soup.find_all('meta', property='og:image')
2215
        return {
2216
            'title': title,
2217
            'img': [i['content'] for i in imgs],
2218
        }
2219
2220
@@ 2857-2874 (lines=18) @@
2854
        }
2855
2856
2857
class GenericCommitStrip(GenericNavigableComic):
2858
    """Generic class to retrieve Commit Strips in different languages."""
2859
    get_navi_link = get_a_rel_next
2860
    get_first_comic_link = simulate_first_link
2861
    first_url = NotImplemented
2862
2863
    @classmethod
2864
    def get_comic_info(cls, soup, link):
2865
        """Get information about a particular comics."""
2866
        desc = soup.find('meta', property='og:description')['content']
2867
        title = soup.find('meta', property='og:title')['content']
2868
        imgs = soup.find('div', class_='entry-content').find_all('img')
2869
        title2 = ' '.join(i.get('title', '') for i in imgs)
2870
        return {
2871
            'title': title,
2872
            'title2': title2,
2873
            'description': desc,
2874
            'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs],
2875
        }
2876
2877