Code Duplication    Length = 23-25 lines in 2 locations

comics.py 2 locations

@@ 2221-2245 (lines=25) @@
2218
        }
2219
2220
2221
class LonnieMillsap(GenericNavigableComic):
2222
    """Class to retrieve Lonnie Millsap's comics."""
2223
    name = 'millsap'
2224
    long_name = 'Lonnie Millsap'
2225
    url = 'http://www.lonniemillsap.com'
2226
    get_navi_link = get_link_rel_next
2227
    get_first_comic_link = simulate_first_link
2228
    first_url = 'http://www.lonniemillsap.com/?p=42'
2229
2230
    @classmethod
2231
    def get_comic_info(cls, soup, link):
2232
        """Get information about a particular comics."""
2233
        title = soup.find('h2', class_='post-title').string
2234
        post = soup.find('div', class_='post-content')
2235
        author = post.find("span", class_="post-author").find("a").string
2236
        date_str = post.find("span", class_="post-date").string
2237
        day = string_to_date(date_str, "%B %d, %Y")
2238
        imgs = post.find("div", class_="entry").find_all("img")
2239
        return {
2240
            'title': title,
2241
            'author': author,
2242
            'img': [i['src'] for i in imgs],
2243
            'month': day.month,
2244
            'year': day.year,
2245
            'day': day.day,
2246
        }
2247
2248
@@ 873-895 (lines=23) @@
870
        }
871
872
873
class TheGentlemanArmchair(GenericNavigableComic):
874
    """Class to retrieve The Gentleman Armchair comics."""
875
    name = 'gentlemanarmchair'
876
    long_name = 'The Gentleman Armchair'
877
    url = 'http://thegentlemansarmchair.com'
878
    get_first_comic_link = get_a_navi_navifirst
879
    get_navi_link = get_link_rel_next
880
881
    @classmethod
882
    def get_comic_info(cls, soup, link):
883
        """Get information about a particular comics."""
884
        title = soup.find('h2', class_='post-title').string
885
        author = soup.find("span", class_="post-author").find("a").string
886
        date_str = soup.find('span', class_='post-date').string
887
        day = string_to_date(date_str, "%B %d, %Y")
888
        imgs = soup.find('div', id='comic').find_all('img')
889
        return {
890
            'img': [i['src'] for i in imgs],
891
            'title': title,
892
            'author': author,
893
            'month': day.month,
894
            'year': day.year,
895
            'day': day.day,
896
        }
897
898