Code Duplication    Length = 24-24 lines in 2 locations

comics.py 2 locations

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