Code Duplication    Length = 23-25 lines in 2 locations

comics.py 2 locations

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