Code Duplication    Length = 21-23 lines in 2 locations

comics.py 2 locations

@@ 645-667 (lines=23) @@
642
    _categories = ('FRANCAIS', )
643
    get_navi_link = get_link_rel_next
644
    get_first_comic_link = simulate_first_link
645
    first_url = 'http://www.penelope-jolicoeur.com/2007/02/ma-vie-mon-oeuv.html'
646
647
    @classmethod
648
    def get_comic_info(cls, soup, link):
649
        """Get information about a particular comics."""
650
        date_str = soup.find('h2', class_='date-header').string
651
        day = string_to_date(date_str, "%A %d %B %Y", "fr_FR.utf8")
652
        imgs = soup.find('div', class_='entry-body').find_all('img')
653
        title = soup.find('h3', class_='entry-header').string
654
        return {
655
            'title': title,
656
            'img': [i['src'] for i in imgs],
657
            'month': day.month,
658
            'year': day.year,
659
            'day': day.day,
660
        }
661
662
663
class OneOneOneOneComic(GenericNavigableComic):
664
    """Class to retrieve 1111 Comics."""
665
    # Also on http://comics1111.tumblr.com
666
    # Also on https://tapastic.com/series/1111-Comics
667
    name = '1111'
668
    long_name = '1111 Comics'
669
    url = 'http://www.1111comics.me'
670
    _categories = ('ONEONEONEONE', )
@@ 1650-1670 (lines=21) @@
1647
    @classmethod
1648
    def get_archive_elements(cls):
1649
        archive_url = urljoin_wrapper(cls.url, 'archive/')
1650
        return reversed(get_soup_at_url(archive_url).find_all('a', rel='bookmark'))
1651
1652
    @classmethod
1653
    def get_comic_info(cls, soup, link):
1654
        """Get information about a particular comics."""
1655
        date_str = soup.find('div', class_='postdate').find('em').string
1656
        day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y")
1657
        div = soup.find('div', id='comic')
1658
        if div:
1659
            img = div.find('img')
1660
            img_src = [img['src']]
1661
            alt = img['alt']
1662
            assert alt == img['title']
1663
            title = soup.find('meta', property='og:title')['content']
1664
        else:
1665
            img_src = []
1666
            alt = ''
1667
            title = ''
1668
        return {
1669
            'month': day.month,
1670
            'year': day.year,
1671
            'day': day.day,
1672
            'img': img_src,
1673
            'title': title,