Code Duplication    Length = 24-24 lines in 3 locations

comics.py 3 locations

@@ 3550-3573 (lines=24) @@
3547
3548
class GloryOwlComix(GenericNavigableComic):
3549
    """Class to retrieve Glory Owl comics."""
3550
    name = 'gloryowl'
3551
    long_name = 'Glory Owl'
3552
    url = 'http://gloryowlcomix.blogspot.fr'
3553
    _categories = ('NSFW', 'FRANCAIS')
3554
    get_first_comic_link = simulate_first_link
3555
    first_url = 'http://gloryowlcomix.blogspot.fr/2013/02/1_7.html'
3556
3557
    @classmethod
3558
    def get_navi_link(cls, last_soup, next_):
3559
        """Get link to next or previous comic."""
3560
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3561
3562
    @classmethod
3563
    def get_comic_info(cls, soup, link):
3564
        """Get information about a particular comics."""
3565
        title = soup.find('title').string
3566
        imgs = soup.find_all('link', rel='image_src')
3567
        author = soup.find('a', rel='author').string
3568
        return {
3569
            'img': [i['href'] for i in imgs],
3570
            'author': author,
3571
            'title': title,
3572
        }
3573
3574
3575
class AtRandomComics(GenericNavigableComic):
3576
    """Class to retrieve At Random Comics."""
@@ 3483-3506 (lines=24) @@
3480
3481
class TuMourrasMoinsBete(GenericNavigableComic):
3482
    """Class to retrieve Tu Mourras Moins Bete comics."""
3483
    name = 'mourrasmoinsbete'
3484
    long_name = 'Tu Mourras Moins Bete'
3485
    url = 'http://tumourrasmoinsbete.blogspot.fr'
3486
    _categories = ('FRANCAIS', )
3487
    get_first_comic_link = simulate_first_link
3488
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3489
3490
    @classmethod
3491
    def get_navi_link(cls, last_soup, next_):
3492
        """Get link to next or previous comic."""
3493
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3494
3495
    @classmethod
3496
    def get_comic_info(cls, soup, link):
3497
        """Get information about a particular comics."""
3498
        title = soup.find('title').string
3499
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3500
        author = soup.find('span', itemprop='author').string
3501
        return {
3502
            'img': [i['src'] for i in imgs],
3503
            'author': author,
3504
            'title': title,
3505
        }
3506
3507
3508
class GeekAndPoke(GenericNavigableComic):
3509
    """Class to retrieve Geek And Poke comics."""
@@ 3269-3292 (lines=24) @@
3266
3267
class EarthExplodes(GenericNavigableComic):
3268
    """Class to retrieve The Earth Explodes comics."""
3269
    name = 'earthexplodes'
3270
    long_name = 'The Earth Explodes'
3271
    url = 'http://www.earthexplodes.com'
3272
    get_url_from_link = join_cls_url_to_href
3273
    get_first_comic_link = simulate_first_link
3274
    first_url = 'http://www.earthexplodes.com/comics/000/'
3275
3276
    @classmethod
3277
    def get_navi_link(cls, last_soup, next_):
3278
        """Get link to next or previous comic."""
3279
        return last_soup.find('a', id='next' if next_ else 'prev')
3280
3281
    @classmethod
3282
    def get_comic_info(cls, soup, link):
3283
        """Get information about a particular comics."""
3284
        title = soup.find('title').string
3285
        imgs = soup.find('div', id='image').find_all('img')
3286
        alt = imgs[0].get('title', '')
3287
        return {
3288
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3289
            'title': title,
3290
            'alt': alt,
3291
        }
3292
3293
3294
class PomComics(GenericNavigableComic):
3295
    """Class to retrieve PomComics."""