Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

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