Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

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