Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

@@ 3191-3214 (lines=24) @@
3188
    _categories = ('FRANCAIS', )
3189
    get_first_comic_link = simulate_first_link
3190
    first_url = 'http://tumourrasmoinsbete.blogspot.fr/2008/06/essai.html'
3191
3192
    @classmethod
3193
    def get_navi_link(cls, last_soup, next_):
3194
        """Get link to next or previous comic."""
3195
        return last_soup.find('a', id='Blog1_blog-pager-newer-link' if next_ else 'Blog1_blog-pager-older-link')
3196
3197
    @classmethod
3198
    def get_comic_info(cls, soup, link):
3199
        """Get information about a particular comics."""
3200
        title = soup.find('title').string
3201
        imgs = soup.find('div', itemprop='description articleBody').find_all('img')
3202
        author = soup.find('span', itemprop='author').string
3203
        return {
3204
            'img': [i['src'] for i in imgs],
3205
            'author': author,
3206
            'title': title,
3207
        }
3208
3209
3210
class GeekAndPoke(GenericNavigableComic):
3211
    """Class to retrieve Geek And Poke comics."""
3212
    name = 'geek'
3213
    long_name = 'Geek And Poke'
3214
    url = 'http://geek-and-poke.com'
3215
    get_url_from_link = join_cls_url_to_href
3216
    get_first_comic_link = simulate_first_link
3217
    first_url = 'http://geek-and-poke.com/geekandpoke/2006/8/27/a-new-place-for-a-not-so-old-blog.html'
@@ 3124-3147 (lines=24) @@
3121
3122
    @classmethod
3123
    def get_navi_link(cls, last_soup, next_):
3124
        """Get link to next or previous comic."""
3125
        class_ = 'glyphicon glyphicon-chevron-' + ('right' if next_ else 'left')
3126
        return last_soup.find('span', class_=class_).parent
3127
3128
    @classmethod
3129
    def get_comic_info(cls, soup, link):
3130
        """Get information about a particular comics."""
3131
        title = soup.find('meta', attrs={'name': 'twitter:title'})['content']
3132
        url2 = soup.find('meta', attrs={'name': 'twitter:url'})['content']
3133
        # date_str = soup.find('h2', class_='comic_title').find('small').string
3134
        # day = string_to_date(date_str, "%B %d, %Y, %I:%M %p")
3135
        imgs = soup.find_all('img', class_='comic img-responsive')
3136
        title2 = imgs[0]['title']
3137
        alt = imgs[0]['alt']
3138
        return {
3139
            'url2': url2,
3140
            'title': title,
3141
            'title2': title2,
3142
            'alt': alt,
3143
            'img': [i['src'] for i in imgs],
3144
        }
3145
3146
3147
class MakeItStoopid(GenericNavigableComic):
3148
    """Class to retrieve Make It Stoopid Comics."""
3149
    name = 'stoopid'
3150
    long_name = 'Make it stoopid'