Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3321-3344 (lines=24) @@
3318
    _categories = ('NSFW', 'FRANCAIS')
3319
    get_first_comic_link = simulate_first_link
3320
    first_url = 'http://gloryowlcomix.blogspot.fr/2013/02/1_7.html'
3321
3322
    @classmethod
3323
    def get_navi_link(cls, last_soup, next_):
3324
        """Get link to next or previous comic."""
3325
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3326
3327
    @classmethod
3328
    def get_comic_info(cls, soup, link):
3329
        """Get information about a particular comics."""
3330
        title = soup.find('title').string
3331
        imgs = soup.find_all('link', rel='image_src')
3332
        author = soup.find('a', rel='author').string
3333
        return {
3334
            'img': [i['href'] for i in imgs],
3335
            'author': author,
3336
            'title': title,
3337
        }
3338
3339
3340
class GenericTumblrV1(GenericComic):
3341
    """Generic class to retrieve comics from Tumblr using the V1 API."""
3342
    _categories = ('TUMBLR', )
3343
3344
    @classmethod
3345
    def get_next_comic(cls, last_comic):
3346
        """Generic implementation of get_next_comic for Tumblr comics."""
3347
        for p in cls.get_posts(last_comic):
@@ 3254-3277 (lines=24) @@
3251
    _categories = ('FRANCAIS', )
3252
    get_first_comic_link = simulate_first_link
3253
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3254
3255
    @classmethod
3256
    def get_navi_link(cls, last_soup, next_):
3257
        """Get link to next or previous comic."""
3258
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3259
3260
    @classmethod
3261
    def get_comic_info(cls, soup, link):
3262
        """Get information about a particular comics."""
3263
        title = soup.find('title').string
3264
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3265
        author = soup.find('span', itemprop='author').string
3266
        return {
3267
            'img': [i['src'] for i in imgs],
3268
            'author': author,
3269
            'title': title,
3270
        }
3271
3272
3273
class GeekAndPoke(GenericNavigableComic):
3274
    """Class to retrieve Geek And Poke comics."""
3275
    name = 'geek'
3276
    long_name = 'Geek And Poke'
3277
    url = 'http://geek-and-poke.com'
3278
    get_url_from_link = join_cls_url_to_href
3279
    get_first_comic_link = simulate_first_link
3280
    first_url = 'http://geek-and-poke.com/geekandpoke/2006/8/27/a-new-place-for-a-not-so-old-blog.html'