Code Duplication    Length = 12-15 lines in 3 locations

comics.py 3 locations

@@ 4184-4198 (lines=15) @@
4181
    # Also on http://www.verbal-vomit.com
4182
    name = 'vomit-tumblr'
4183
    long_name = 'Verbal Vomit (from Tumblr)'
4184
    url = 'http://verbalvomits.tumblr.com'
4185
4186
4187
class LibraryComic(GenericTumblrV1):
4188
    """Class to retrieve LibraryComic."""
4189
    # Also on http://librarycomic.com
4190
    name = 'library-tumblr'
4191
    long_name = 'LibraryComic (from Tumblr)'
4192
    url = 'http://librarycomic.tumblr.com'
4193
4194
4195
class HorovitzComics(GenericListableComic):
4196
    """Generic class to handle the logic common to the different comics from Horovitz."""
4197
    url = 'http://www.horovitzcomics.com'
4198
    _categories = ('HOROVITZ', )
4199
    img_re = re.compile('.*comics/([0-9]*)/([0-9]*)/([0-9]*)/.*$')
4200
    link_re = NotImplemented
4201
    get_url_from_archive_element = join_cls_url_to_href
@@ 2952-2964 (lines=13) @@
2949
2950
2951
class GenericWordPressInkblot(GenericNavigableComic):
2952
    """Generic class to retrieve comics using WordPress with Inkblot."""
2953
    get_navi_link = get_link_rel_next
2954
2955
    @classmethod
2956
    def get_first_comic_link(cls):
2957
        """Get link to first comics."""
2958
        return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link')
2959
2960
    @classmethod
2961
    def get_comic_info(cls, soup, link):
2962
        """Get information about a particular comics."""
2963
        title = soup.find('meta', property='og:title')['content']
2964
        imgs = soup.find('div', class_='webcomic-image').find_all('img')
2965
        date_str = soup.find('meta', property='article:published_time')['content'][:10]
2966
        day = string_to_date(date_str, "%Y-%m-%d")
2967
        return {
@@ 2656-2667 (lines=12) @@
2653
            'img': [i['src'] for i in imgs],
2654
            'title': imgs[0]['title'],
2655
        }
2656
2657
2658
class GenericCommitStrip(GenericNavigableComic):
2659
    """Generic class to retrieve Commit Strips in different languages."""
2660
    get_navi_link = get_a_rel_next
2661
    get_first_comic_link = simulate_first_link
2662
    first_url = NotImplemented
2663
2664
    @classmethod
2665
    def get_comic_info(cls, soup, link):
2666
        """Get information about a particular comics."""
2667
        desc = soup.find('meta', property='og:description')['content']
2668
        title = soup.find('meta', property='og:title')['content']
2669
        imgs = soup.find('div', class_='entry-content').find_all('img')
2670
        title2 = ' '.join(i.get('title', '') for i in imgs)