Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

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