Code Duplication    Length = 18-18 lines in 2 locations

comics.py 2 locations

@@ 3510-3527 (lines=18) @@
3507
            'day': day.day,
3508
            'month': day.month,
3509
            'year': day.year,
3510
        }
3511
3512
3513
class GeekAndPoke(GenericNavigableComic):
3514
    """Class to retrieve Geek And Poke comics."""
3515
    name = 'geek'
3516
    long_name = 'Geek And Poke'
3517
    url = 'http://geek-and-poke.com'
3518
    get_url_from_link = join_cls_url_to_href
3519
    get_first_comic_link = simulate_first_link
3520
    first_url = 'http://geek-and-poke.com/geekandpoke/2006/8/27/a-new-place-for-a-not-so-old-blog.html'
3521
3522
    @classmethod
3523
    def get_navi_link(cls, last_soup, next_):
3524
        """Get link to next or previous comic."""
3525
        return last_soup.find('a', class_='prev-item' if next_ else 'next-item')
3526
3527
    @classmethod
3528
    def get_comic_info(cls, soup, link):
3529
        """Get information about a particular comics."""
3530
        title = soup.find('meta', property='og:title')['content']
@@ 3425-3442 (lines=18) @@
3422
3423
class ConsoliaComics(GenericNavigableComic):
3424
    """Class to retrieve Consolia comics."""
3425
    name = 'consolia'
3426
    long_name = 'consolia'
3427
    url = 'https://consolia-comic.com'
3428
    get_url_from_link = join_cls_url_to_href
3429
3430
    @classmethod
3431
    def get_first_comic_link(cls):
3432
        """Get link to first comics."""
3433
        return get_soup_at_url(cls.url).find('a', class_='first')
3434
3435
    @classmethod
3436
    def get_navi_link(cls, last_soup, next_):
3437
        """Get link to next or previous comic."""
3438
        return last_soup.find('a', class_='next' if next_ else 'prev')
3439
3440
    @classmethod
3441
    def get_comic_info(cls, soup, link):
3442
        """Get information about a particular comics."""
3443
        title = soup.find('meta', property='og:title')['content']
3444
        date_str = soup.find('time')["datetime"]
3445
        day = string_to_date(date_str, "%Y-%m-%d")