Code Duplication    Length = 23-28 lines in 2 locations

comics.py 2 locations

@@ 2232-2259 (lines=28) @@
2229
                    }
2230
2231
2232
class LonnieMillsap(GenericNavigableComic):
2233
    """Class to retrieve Lonnie Millsap's comics."""
2234
    name = 'millsap'
2235
    long_name = 'Lonnie Millsap'
2236
    url = 'http://www.lonniemillsap.com'
2237
    get_navi_link = get_link_rel_next
2238
2239
    @classmethod
2240
    def get_first_comic_link(cls):
2241
        """Get link to first comics."""
2242
        return {'href': 'http://www.lonniemillsap.com/?p=42'}
2243
2244
    @classmethod
2245
    def get_comic_info(cls, soup, link):
2246
        """Get information about a particular comics."""
2247
        title = soup.find('h2', class_='post-title').string
2248
        post = soup.find('div', class_='post-content')
2249
        author = post.find("span", class_="post-author").find("a").string
2250
        date_str = post.find("span", class_="post-date").string
2251
        day = string_to_date(date_str, "%B %d, %Y")
2252
        imgs = post.find("div", class_="entry").find_all("img")
2253
        return {
2254
            'title': title,
2255
            'author': author,
2256
            'img': [i['src'] for i in imgs],
2257
            'month': day.month,
2258
            'year': day.year,
2259
            'day': day.day,
2260
        }
2261
2262
@@ 882-904 (lines=23) @@
879
        }
880
881
882
class TheGentlemanArmchair(GenericNavigableComic):
883
    """Class to retrieve The Gentleman Armchair comics."""
884
    name = 'gentlemanarmchair'
885
    long_name = 'The Gentleman Armchair'
886
    url = 'http://thegentlemansarmchair.com'
887
    get_first_comic_link = get_a_navi_navifirst
888
    get_navi_link = get_link_rel_next
889
890
    @classmethod
891
    def get_comic_info(cls, soup, link):
892
        """Get information about a particular comics."""
893
        title = soup.find('h2', class_='post-title').string
894
        author = soup.find("span", class_="post-author").find("a").string
895
        date_str = soup.find('span', class_='post-date').string
896
        day = string_to_date(date_str, "%B %d, %Y")
897
        imgs = soup.find('div', id='comic').find_all('img')
898
        return {
899
            'img': [i['src'] for i in imgs],
900
            'title': title,
901
            'author': author,
902
            'month': day.month,
903
            'year': day.year,
904
            'day': day.day,
905
        }
906
907