Code Duplication    Length = 12-15 lines in 3 locations

comics.py 3 locations

@@ 4184-4198 (lines=15) @@
4181
    url = 'http://verbalvomits.tumblr.com'
4182
4183
4184
class LibraryComic(GenericTumblrV1):
4185
    """Class to retrieve LibraryComic."""
4186
    # Also on http://librarycomic.com
4187
    name = 'library-tumblr'
4188
    long_name = 'LibraryComic (from Tumblr)'
4189
    url = 'http://librarycomic.tumblr.com'
4190
4191
4192
class TizzyStitchBirdTumblr(GenericTumblrV1):
4193
    """Class to retrieve Tizzy Stitch Bird comics."""
4194
    # Also on http://tizzystitchbird.com
4195
    # Also on https://tapastic.com/series/TizzyStitchbird
4196
    # Also on http://www.webtoons.com/en/challenge/tizzy-stitchbird/list?title_no=50082
4197
    name = 'tizzy-tumblr'
4198
    long_name = 'Tizzy Stitch Bird (from Tumblr)'
4199
    url = 'http://tizzystitchbird.tumblr.com'
4200
4201
@@ 2952-2964 (lines=13) @@
2949
    """Generic class to retrieve comics using WordPress with Inkblot."""
2950
    get_navi_link = get_link_rel_next
2951
2952
    @classmethod
2953
    def get_first_comic_link(cls):
2954
        """Get link to first comics."""
2955
        return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link')
2956
2957
    @classmethod
2958
    def get_comic_info(cls, soup, link):
2959
        """Get information about a particular comics."""
2960
        title = soup.find('meta', property='og:title')['content']
2961
        imgs = soup.find('div', class_='webcomic-image').find_all('img')
2962
        date_str = soup.find('meta', property='article:published_time')['content'][:10]
2963
        day = string_to_date(date_str, "%Y-%m-%d")
2964
        return {
2965
            'title': title,
2966
            'day': day.day,
2967
            'month': day.month,
@@ 2656-2667 (lines=12) @@
2653
2654
2655
class GenericCommitStrip(GenericNavigableComic):
2656
    """Generic class to retrieve Commit Strips in different languages."""
2657
    get_navi_link = get_a_rel_next
2658
    get_first_comic_link = simulate_first_link
2659
    first_url = NotImplemented
2660
2661
    @classmethod
2662
    def get_comic_info(cls, soup, link):
2663
        """Get information about a particular comics."""
2664
        desc = soup.find('meta', property='og:description')['content']
2665
        title = soup.find('meta', property='og:title')['content']
2666
        imgs = soup.find('div', class_='entry-content').find_all('img')
2667
        title2 = ' '.join(i.get('title', '') for i in imgs)
2668
        return {
2669
            'title': title,
2670
            'title2': title2,