Code Duplication    Length = 21-29 lines in 26 locations

comics.py 26 locations

@@ 1853-1879 (lines=27) @@
1850
        }
1851
1852
1853
class PicturesInBoxes(GenericNavigableComic):
1854
    """Class to retrieve Pictures In Boxes comics."""
1855
    # Also on https://picturesinboxescomic.tumblr.com
1856
    name = 'picturesinboxes'
1857
    long_name = 'Pictures in Boxes'
1858
    url = 'http://www.picturesinboxes.com'
1859
    get_navi_link = get_a_navi_navinext
1860
    get_first_comic_link = simulate_first_link
1861
    first_url = 'http://www.picturesinboxes.com/2013/10/26/tetris/'
1862
1863
    @classmethod
1864
    def get_comic_info(cls, soup, link):
1865
        """Get information about a particular comics."""
1866
        title = soup.find('h2', class_='post-title').string
1867
        author = soup.find("span", class_="post-author").find("a").string
1868
        date_str = soup.find('span', class_='post-date').string
1869
        day = string_to_date(date_str, '%B %d, %Y')
1870
        imgs = soup.find('div', class_='comicpane').find_all('img')
1871
        assert imgs
1872
        assert all(i['title'] == i['alt'] == title for i in imgs)
1873
        return {
1874
            'day': day.day,
1875
            'month': day.month,
1876
            'year': day.year,
1877
            'img': [i['src'] for i in imgs],
1878
            'title': title,
1879
            'author': author,
1880
        }
1881
1882
@@ 2553-2578 (lines=26) @@
2550
        }
2551
2552
2553
class TheAwkwardYeti(GenericNavigableComic):
2554
    """Class to retrieve The Awkward Yeti comics."""
2555
    # Also on http://www.gocomics.com/the-awkward-yeti
2556
    # Also on http://larstheyeti.tumblr.com
2557
    # Also on https://tapastic.com/series/TheAwkwardYeti
2558
    name = 'yeti'
2559
    long_name = 'The Awkward Yeti'
2560
    url = 'http://theawkwardyeti.com'
2561
    _categories = ('YETI', )
2562
    get_first_comic_link = get_a_navi_navifirst
2563
    get_navi_link = get_link_rel_next
2564
2565
    @classmethod
2566
    def get_comic_info(cls, soup, link):
2567
        """Get information about a particular comics."""
2568
        title = soup.find('h2', class_='post-title').string
2569
        date_str = soup.find("span", class_="post-date").string
2570
        day = string_to_date(date_str, "%B %d, %Y")
2571
        imgs = soup.find("div", id="comic").find_all("img")
2572
        assert all(idx > 0 or i['alt'] == i['title'] for idx, i in enumerate(imgs))
2573
        return {
2574
            'img': [i['src'] for i in imgs],
2575
            'title': title,
2576
            'day': day.day,
2577
            'month': day.month,
2578
            'year': day.year
2579
        }
2580
2581
@@ 2466-2491 (lines=26) @@
2463
        }
2464
2465
2466
class GerbilWithAJetpack(GenericNavigableComic):
2467
    """Class to retrieve GerbilWithAJetpack comics."""
2468
    name = 'gerbil'
2469
    long_name = 'Gerbil With A Jetpack'
2470
    url = 'http://gerbilwithajetpack.com'
2471
    get_first_comic_link = get_a_navi_navifirst
2472
    get_navi_link = get_a_rel_next
2473
2474
    @classmethod
2475
    def get_comic_info(cls, soup, link):
2476
        """Get information about a particular comics."""
2477
        title = soup.find('h2', class_='post-title').string
2478
        author = soup.find("span", class_="post-author").find("a").string
2479
        date_str = soup.find("span", class_="post-date").string
2480
        day = string_to_date(date_str, "%B %d, %Y")
2481
        imgs = soup.find("div", id="comic").find_all("img")
2482
        alt = imgs[0]['alt']
2483
        assert all(i['alt'] == i['title'] == alt for i in imgs)
2484
        return {
2485
            'img': [i['src'] for i in imgs],
2486
            'title': title,
2487
            'alt': alt,
2488
            'author': author,
2489
            'day': day.day,
2490
            'month': day.month,
2491
            'year': day.year
2492
        }
2493
2494
@@ 2807-2831 (lines=25) @@
2804
    first_url = 'http://www.commitstrip.com/en/2012/02/22/interview/'
2805
2806
2807
class GenericBoumerie(GenericNavigableComic):
2808
    """Generic class to retrieve Boumeries comics in different languages."""
2809
    get_first_comic_link = get_a_navi_navifirst
2810
    get_navi_link = get_link_rel_next
2811
    date_format = NotImplemented
2812
    lang = NotImplemented
2813
2814
    @classmethod
2815
    def get_comic_info(cls, soup, link):
2816
        """Get information about a particular comics."""
2817
        title = soup.find('h2', class_='post-title').string
2818
        short_url = soup.find('link', rel='shortlink')['href']
2819
        author = soup.find("span", class_="post-author").find("a").string
2820
        date_str = soup.find('span', class_='post-date').string
2821
        day = string_to_date(date_str, cls.date_format, cls.lang)
2822
        imgs = soup.find('div', id='comic').find_all('img')
2823
        assert all(i['alt'] == i['title'] for i in imgs)
2824
        return {
2825
            'short_url': short_url,
2826
            'img': [i['src'] for i in imgs],
2827
            'title': title,
2828
            'author': author,
2829
            'month': day.month,
2830
            'year': day.year,
2831
            'day': day.day,
2832
        }
2833
2834
@@ 2495-2519 (lines=25) @@
2492
        }
2493
2494
2495
class EveryDayBlues(GenericDeletedComic, GenericNavigableComic):
2496
    """Class to retrieve EveryDayBlues Comics."""
2497
    name = "blues"
2498
    long_name = "Every Day Blues"
2499
    url = "http://everydayblues.net"
2500
    get_first_comic_link = get_a_navi_navifirst
2501
    get_navi_link = get_link_rel_next
2502
2503
    @classmethod
2504
    def get_comic_info(cls, soup, link):
2505
        """Get information about a particular comics."""
2506
        title = soup.find("h2", class_="post-title").string
2507
        author = soup.find("span", class_="post-author").find("a").string
2508
        date_str = soup.find("span", class_="post-date").string
2509
        day = string_to_date(date_str, "%d. %B %Y", "de_DE.utf8")
2510
        imgs = soup.find("div", id="comic").find_all("img")
2511
        assert all(i['alt'] == i['title'] == title for i in imgs)
2512
        assert len(imgs) <= 1
2513
        return {
2514
            'img': [i['src'] for i in imgs],
2515
            'title': title,
2516
            'author': author,
2517
            'day': day.day,
2518
            'month': day.month,
2519
            'year': day.year
2520
        }
2521
2522
@@ 1741-1765 (lines=25) @@
1738
        }
1739
1740
1741
class MouseBearComedy(GenericComicNotWorking):  # Website has changed
1742
    """Class to retrieve Mouse Bear Comedy comics."""
1743
    # Also on http://mousebearcomedy.tumblr.com
1744
    name = 'mousebear'
1745
    long_name = 'Mouse Bear Comedy'
1746
    url = 'http://www.mousebearcomedy.com'
1747
    get_first_comic_link = get_a_navi_navifirst
1748
    get_navi_link = get_a_navi_comicnavnext_navinext
1749
1750
    @classmethod
1751
    def get_comic_info(cls, soup, link):
1752
        """Get information about a particular comics."""
1753
        title = soup.find('h2', class_='post-title').string
1754
        author = soup.find("span", class_="post-author").find("a").string
1755
        date_str = soup.find("span", class_="post-date").string
1756
        day = string_to_date(date_str, '%B %d, %Y')
1757
        imgs = soup.find("div", id="comic").find_all("img")
1758
        assert all(i['alt'] == i['title'] == title for i in imgs)
1759
        return {
1760
            'day': day.day,
1761
            'month': day.month,
1762
            'year': day.year,
1763
            'img': [i['src'] for i in imgs],
1764
            'title': title,
1765
            'author': author,
1766
        }
1767
1768
@@ 1185-1208 (lines=24) @@
1182
    url = 'http://english.bouletcorp.com'
1183
1184
1185
class AmazingSuperPowers(GenericNavigableComic):
1186
    """Class to retrieve Amazing Super Powers comics."""
1187
    name = 'asp'
1188
    long_name = 'Amazing Super Powers'
1189
    url = 'http://www.amazingsuperpowers.com'
1190
    get_first_comic_link = get_a_navi_navifirst
1191
    get_navi_link = get_a_navi_navinext
1192
1193
    @classmethod
1194
    def get_comic_info(cls, soup, link):
1195
        """Get information about a particular comics."""
1196
        author = soup.find("span", class_="post-author").find("a").string
1197
        date_str = soup.find('span', class_='post-date').string
1198
        day = string_to_date(date_str, "%B %d, %Y")
1199
        imgs = soup.find('div', id='comic').find_all('img')
1200
        title = ' '.join(i['title'] for i in imgs)
1201
        assert all(i['alt'] == i['title'] for i in imgs)
1202
        return {
1203
            'title': title,
1204
            'author': author,
1205
            'img': [img['src'] for img in imgs],
1206
            'day': day.day,
1207
            'month': day.month,
1208
            'year': day.year
1209
        }
1210
1211
@@ 702-725 (lines=24) @@
699
        }
700
701
702
class OneOneOneOneComic(GenericComicNotWorking, GenericNavigableComic):
703
    """Class to retrieve 1111 Comics."""
704
    # Also on http://comics1111.tumblr.com
705
    # Also on https://tapastic.com/series/1111-Comics
706
    name = '1111'
707
    long_name = '1111 Comics'
708
    url = 'http://www.1111comics.me'
709
    _categories = ('ONEONEONEONE', )
710
    get_first_comic_link = get_div_navfirst_a
711
    get_navi_link = get_link_rel_next
712
713
    @classmethod
714
    def get_comic_info(cls, soup, link):
715
        """Get information about a particular comics."""
716
        title = soup.find('h1', class_='comic-title').find('a').string
717
        date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string
718
        day = string_to_date(date_str, "%B %d, %Y")
719
        imgs = soup.find_all('meta', property='og:image')
720
        return {
721
            'title': title,
722
            'month': day.month,
723
            'year': day.year,
724
            'day': day.day,
725
            'img': [i['content'] for i in imgs],
726
        }
727
728
@@ 930-952 (lines=23) @@
927
        }
928
929
930
class TheGentlemanArmchair(GenericNavigableComic):
931
    """Class to retrieve The Gentleman Armchair comics."""
932
    name = 'gentlemanarmchair'
933
    long_name = 'The Gentleman Armchair'
934
    url = 'http://thegentlemansarmchair.com'
935
    get_first_comic_link = get_a_navi_navifirst
936
    get_navi_link = get_link_rel_next
937
938
    @classmethod
939
    def get_comic_info(cls, soup, link):
940
        """Get information about a particular comics."""
941
        title = soup.find('h2', class_='post-title').string
942
        author = soup.find("span", class_="post-author").find("a").string
943
        date_str = soup.find('span', class_='post-date').string
944
        day = string_to_date(date_str, "%B %d, %Y")
945
        imgs = soup.find('div', id='comic').find_all('img')
946
        return {
947
            'img': [i['src'] for i in imgs],
948
            'title': title,
949
            'author': author,
950
            'month': day.month,
951
            'year': day.year,
952
            'day': day.day,
953
        }
954
955
@@ 729-750 (lines=22) @@
726
        }
727
728
729
class AngryAtNothing(GenericDeletedComic, GenericNavigableComic):
730
    """Class to retrieve Angry at Nothing comics."""
731
    # Also on http://tapastic.com/series/Comics-yeah-definitely-comics-
732
    # Also on http://angryatnothing.tumblr.com
733
    name = 'angry'
734
    long_name = 'Angry At Nothing'
735
    url = 'http://www.angryatnothing.net'
736
    get_first_comic_link = get_div_navfirst_a
737
    get_navi_link = get_a_rel_next
738
739
    @classmethod
740
    def get_comic_info(cls, soup, link):
741
        """Get information about a particular comics."""
742
        title = soup.find('h1', class_='comic-title').find('a').string
743
        date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string
744
        day = string_to_date(date_str, "%B %d, %Y")
745
        imgs = soup.find_all('meta', property='og:image')
746
        return {
747
            'title': title,
748
            'month': day.month,
749
            'year': day.year,
750
            'day': day.day,
751
            'img': [i['content'] for i in imgs],
752
        }
753
@@ 2664-2692 (lines=29) @@
2661
        }
2662
2663
2664
class TalesOfAbsurdity(GenericNavigableComic):
2665
    """Class to retrieve Tales Of Absurdity comics."""
2666
    # Also on http://tapastic.com/series/Tales-Of-Absurdity
2667
    # Also on http://talesofabsurdity.tumblr.com
2668
    name = 'absurdity'
2669
    long_name = 'Tales of Absurdity'
2670
    url = 'http://talesofabsurdity.com'
2671
    _categories = ('ABSURDITY', )
2672
    get_first_comic_link = get_a_navi_navifirst
2673
    get_navi_link = get_a_navi_comicnavnext_navinext
2674
2675
    @classmethod
2676
    def get_comic_info(cls, soup, link):
2677
        """Get information about a particular comics."""
2678
        title = soup.find('h2', class_='post-title').string
2679
        author = soup.find("span", class_="post-author").find("a").string
2680
        date_str = soup.find("span", class_="post-date").string
2681
        day = string_to_date(date_str, "%B %d, %Y")
2682
        imgs = soup.find("div", id="comic").find_all("img")
2683
        assert all(i['alt'] == i['title'] for i in imgs)
2684
        alt = imgs[0]['alt'] if imgs else ""
2685
        return {
2686
            'img': [i['src'] for i in imgs],
2687
            'title': title,
2688
            'alt': alt,
2689
            'author': author,
2690
            'day': day.day,
2691
            'month': day.month,
2692
            'year': day.year
2693
        }
2694
2695
@@ 2602-2630 (lines=29) @@
2599
        }
2600
2601
2602
class MisterAndMe(GenericNavigableComic):
2603
    """Class to retrieve Mister & Me Comics."""
2604
    # Also on http://www.gocomics.com/mister-and-me
2605
    # Also on https://tapastic.com/series/Mister-and-Me
2606
    name = 'mister'
2607
    long_name = 'Mister & Me'
2608
    url = 'http://www.mister-and-me.com'
2609
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2610
    get_navi_link = get_link_rel_next
2611
2612
    @classmethod
2613
    def get_comic_info(cls, soup, link):
2614
        """Get information about a particular comics."""
2615
        title = soup.find('h2', class_='post-title').string
2616
        author = soup.find("span", class_="post-author").find("a").string
2617
        date_str = soup.find("span", class_="post-date").string
2618
        day = string_to_date(date_str, "%B %d, %Y")
2619
        imgs = soup.find("div", id="comic").find_all("img")
2620
        assert all(i['alt'] == i['title'] for i in imgs)
2621
        assert len(imgs) <= 1
2622
        alt = imgs[0]['alt'] if imgs else ""
2623
        return {
2624
            'img': [i['src'] for i in imgs],
2625
            'title': title,
2626
            'alt': alt,
2627
            'author': author,
2628
            'day': day.day,
2629
            'month': day.month,
2630
            'year': day.year
2631
        }
2632
2633
@@ 2888-2914 (lines=27) @@
2885
        }
2886
2887
2888
class Optipess(GenericNavigableComic):
2889
    """Class to retrieve Optipess comics."""
2890
    name = 'optipess'
2891
    long_name = 'Optipess'
2892
    url = 'http://www.optipess.com'
2893
    get_first_comic_link = get_a_navi_navifirst
2894
    get_navi_link = get_link_rel_next
2895
2896
    @classmethod
2897
    def get_comic_info(cls, soup, link):
2898
        """Get information about a particular comics."""
2899
        title = soup.find('h2', class_='post-title').string
2900
        author = soup.find("span", class_="post-author").find("a").string
2901
        comic = soup.find('div', id='comic')
2902
        imgs = comic.find_all('img') if comic else []
2903
        alt = imgs[0]['title'] if imgs else ""
2904
        assert all(i['alt'] == i['title'] == alt for i in imgs)
2905
        date_str = soup.find('span', class_='post-date').string
2906
        day = string_to_date(date_str, "%B %d, %Y")
2907
        return {
2908
            'title': title,
2909
            'alt': alt,
2910
            'author': author,
2911
            'img': [i['src'] for i in imgs],
2912
            'month': day.month,
2913
            'year': day.year,
2914
            'day': day.day,
2915
        }
2916
2917
@@ 2523-2549 (lines=27) @@
2520
        }
2521
2522
2523
class BiterComics(GenericNavigableComic):
2524
    """Class to retrieve Biter Comics."""
2525
    name = "biter"
2526
    long_name = "Biter Comics"
2527
    url = "http://www.bitercomics.com"
2528
    get_first_comic_link = get_a_navi_navifirst
2529
    get_navi_link = get_link_rel_next
2530
2531
    @classmethod
2532
    def get_comic_info(cls, soup, link):
2533
        """Get information about a particular comics."""
2534
        title = soup.find("h1", class_="entry-title").string
2535
        author = soup.find("span", class_="author vcard").find("a").string
2536
        date_str = soup.find("span", class_="entry-date").string
2537
        day = string_to_date(date_str, "%B %d, %Y")
2538
        imgs = soup.find("div", id="comic").find_all("img")
2539
        assert all(i['alt'] == i['title'] for i in imgs)
2540
        assert len(imgs) == 1
2541
        alt = imgs[0]['alt']
2542
        return {
2543
            'img': [i['src'] for i in imgs],
2544
            'title': title,
2545
            'alt': alt,
2546
            'author': author,
2547
            'day': day.day,
2548
            'month': day.month,
2549
            'year': day.year
2550
        }
2551
2552
@@ 1998-2024 (lines=27) @@
1995
    _categories = ('TUNEYTOONS', )
1996
1997
1998
class CompletelySeriousComics(GenericNavigableComic):
1999
    """Class to retrieve Completely Serious comics."""
2000
    name = 'completelyserious'
2001
    long_name = 'Completely Serious Comics'
2002
    url = 'http://completelyseriouscomics.com'
2003
    get_first_comic_link = get_a_navi_navifirst
2004
    get_navi_link = get_a_navi_navinext
2005
2006
    @classmethod
2007
    def get_comic_info(cls, soup, link):
2008
        """Get information about a particular comics."""
2009
        title = soup.find('h2', class_='post-title').string
2010
        author = soup.find('span', class_='post-author').contents[1].string
2011
        date_str = soup.find('span', class_='post-date').string
2012
        day = string_to_date(date_str, '%B %d, %Y')
2013
        imgs = soup.find('div', class_='comicpane').find_all('img')
2014
        assert imgs
2015
        alt = imgs[0]['title']
2016
        assert all(i['title'] == i['alt'] == alt for i in imgs)
2017
        return {
2018
            'month': day.month,
2019
            'year': day.year,
2020
            'day': day.day,
2021
            'img': [i['src'] for i in imgs],
2022
            'title': title,
2023
            'alt': alt,
2024
            'author': author,
2025
        }
2026
2027
@@ 2696-2721 (lines=26) @@
2693
        }
2694
2695
2696
class EndlessOrigami(GenericComicNotWorking, GenericNavigableComic):  # Nav not working
2697
    """Class to retrieve Endless Origami Comics."""
2698
    name = "origami"
2699
    long_name = "Endless Origami"
2700
    url = "http://endlessorigami.com"
2701
    get_first_comic_link = get_a_navi_navifirst
2702
    get_navi_link = get_link_rel_next
2703
2704
    @classmethod
2705
    def get_comic_info(cls, soup, link):
2706
        """Get information about a particular comics."""
2707
        title = soup.find('h2', class_='post-title').string
2708
        author = soup.find("span", class_="post-author").find("a").string
2709
        date_str = soup.find("span", class_="post-date").string
2710
        day = string_to_date(date_str, "%B %d, %Y")
2711
        imgs = soup.find("div", id="comic").find_all("img")
2712
        assert all(i['alt'] == i['title'] for i in imgs)
2713
        alt = imgs[0]['alt'] if imgs else ""
2714
        return {
2715
            'img': [i['src'] for i in imgs],
2716
            'title': title,
2717
            'alt': alt,
2718
            'author': author,
2719
            'day': day.day,
2720
            'month': day.month,
2721
            'year': day.year
2722
        }
2723
2724
@@ 2209-2234 (lines=26) @@
2206
        return reversed(get_soup_at_url(archive_url).find('tbody').find_all('tr'))
2207
2208
2209
class HappleTea(GenericNavigableComic):
2210
    """Class to retrieve Happle Tea Comics."""
2211
    name = 'happletea'
2212
    long_name = 'Happle Tea'
2213
    url = 'http://www.happletea.com'
2214
    get_first_comic_link = get_a_navi_navifirst
2215
    get_navi_link = get_link_rel_next
2216
2217
    @classmethod
2218
    def get_comic_info(cls, soup, link):
2219
        """Get information about a particular comics."""
2220
        imgs = soup.find('div', id='comic').find_all('img')
2221
        post = soup.find('div', class_='post-content')
2222
        title = post.find('h2', class_='post-title').string
2223
        author = post.find('a', rel='author').string
2224
        date_str = post.find('span', class_='post-date').string
2225
        day = string_to_date(date_str, "%B %d, %Y")
2226
        assert all(i['alt'] == i['title'] for i in imgs)
2227
        return {
2228
            'title': title,
2229
            'img': [i['src'] for i in imgs],
2230
            'alt': ''.join(i['alt'] for i in imgs),
2231
            'month': day.month,
2232
            'year': day.year,
2233
            'day': day.day,
2234
            'author': author,
2235
        }
2236
2237
@@ 1883-1908 (lines=26) @@
1880
        }
1881
1882
1883
class Penmen(GenericNavigableComic):
1884
    """Class to retrieve Penmen comics."""
1885
    name = 'penmen'
1886
    long_name = 'Penmen'
1887
    url = 'http://penmen.com'
1888
    get_navi_link = get_link_rel_next
1889
    get_first_comic_link = simulate_first_link
1890
    first_url = 'http://penmen.com/index.php/2016/09/12/penmen-announces-grin-big-brand-clothing/'
1891
1892
    @classmethod
1893
    def get_comic_info(cls, soup, link):
1894
        """Get information about a particular comics."""
1895
        title = soup.find('title').string
1896
        imgs = soup.find('div', class_='entry-content').find_all('img')
1897
        short_url = soup.find('link', rel='shortlink')['href']
1898
        tags = ' '.join(t.string for t in soup.find_all('a', rel='tag'))
1899
        date_str = soup.find('time')['datetime'][:10]
1900
        day = string_to_date(date_str, "%Y-%m-%d")
1901
        return {
1902
            'title': title,
1903
            'short_url': short_url,
1904
            'img': [i['src'] for i in imgs],
1905
            'tags': tags,
1906
            'month': day.month,
1907
            'year': day.year,
1908
            'day': day.day,
1909
        }
1910
1911
@@ 1824-1849 (lines=26) @@
1821
        }
1822
1823
1824
class SafelyEndangered(GenericNavigableComic):
1825
    """Class to retrieve Safely Endangered comics."""
1826
    # Also on http://tumblr.safelyendangered.com
1827
    name = 'endangered'
1828
    long_name = 'Safely Endangered'
1829
    url = 'http://www.safelyendangered.com'
1830
    get_navi_link = get_link_rel_next
1831
    get_first_comic_link = simulate_first_link
1832
    first_url = 'http://www.safelyendangered.com/comic/ignored/'
1833
1834
    @classmethod
1835
    def get_comic_info(cls, soup, link):
1836
        """Get information about a particular comics."""
1837
        title = soup.find('h2', class_='post-title').string
1838
        date_str = soup.find('span', class_='post-date').string
1839
        day = string_to_date(date_str, '%B %d, %Y')
1840
        imgs = soup.find('div', id='comic').find_all('img')
1841
        alt = imgs[0]['alt']
1842
        assert all(i['alt'] == i['title'] for i in imgs)
1843
        return {
1844
            'day': day.day,
1845
            'month': day.month,
1846
            'year': day.year,
1847
            'img': [i['src'] for i in imgs],
1848
            'title': title,
1849
            'alt': alt,
1850
        }
1851
1852
@@ 2365-2389 (lines=25) @@
2362
        }
2363
2364
2365
class LonnieMillsap(GenericNavigableComic):
2366
    """Class to retrieve Lonnie Millsap's comics."""
2367
    name = 'millsap'
2368
    long_name = 'Lonnie Millsap'
2369
    url = 'http://www.lonniemillsap.com'
2370
    get_navi_link = get_link_rel_next
2371
    get_first_comic_link = simulate_first_link
2372
    first_url = 'http://www.lonniemillsap.com/?p=42'
2373
2374
    @classmethod
2375
    def get_comic_info(cls, soup, link):
2376
        """Get information about a particular comics."""
2377
        title = soup.find('h2', class_='post-title').string
2378
        post = soup.find('div', class_='post-content')
2379
        author = post.find("span", class_="post-author").find("a").string
2380
        date_str = post.find("span", class_="post-date").string
2381
        day = string_to_date(date_str, "%B %d, %Y")
2382
        imgs = post.find("div", class_="entry").find_all("img")
2383
        return {
2384
            'title': title,
2385
            'author': author,
2386
            'img': [i['src'] for i in imgs],
2387
            'month': day.month,
2388
            'year': day.year,
2389
            'day': day.day,
2390
        }
2391
2392
@@ 2086-2110 (lines=25) @@
2083
        }
2084
2085
2086
class ChuckleADuck(GenericNavigableComic):
2087
    """Class to retrieve Chuckle-A-Duck comics."""
2088
    name = 'chuckleaduck'
2089
    long_name = 'Chuckle-A-duck'
2090
    url = 'http://chuckleaduck.com'
2091
    get_first_comic_link = get_div_navfirst_a
2092
    get_navi_link = get_link_rel_next
2093
2094
    @classmethod
2095
    def get_comic_info(cls, soup, link):
2096
        """Get information about a particular comics."""
2097
        date_str = soup.find('span', class_='post-date').string
2098
        day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y")
2099
        author = soup.find('span', class_='post-author').string
2100
        div = soup.find('div', id='comic')
2101
        imgs = div.find_all('img') if div else []
2102
        title = imgs[0]['title'] if imgs else ""
2103
        assert all(i['title'] == i['alt'] == title for i in imgs)
2104
        return {
2105
            'month': day.month,
2106
            'year': day.year,
2107
            'day': day.day,
2108
            'img': [i['src'] for i in imgs],
2109
            'title': title,
2110
            'author': author,
2111
        }
2112
2113
@@ 3173-3196 (lines=24) @@
3170
        }
3171
3172
3173
class Ubertool(GenericNavigableComic):
3174
    """Class to retrieve Ubertool comics."""
3175
    # Also on https://ubertool.tumblr.com
3176
    # Also on https://tapastic.com/series/ubertool
3177
    name = 'ubertool'
3178
    long_name = 'Ubertool'
3179
    url = 'http://ubertoolcomic.com'
3180
    _categories = ('UBERTOOL', )
3181
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
3182
    get_navi_link = get_a_comicnavbase_comicnavnext
3183
3184
    @classmethod
3185
    def get_comic_info(cls, soup, link):
3186
        """Get information about a particular comics."""
3187
        title = soup.find('h2', class_='post-title').string
3188
        date_str = soup.find('span', class_='post-date').string
3189
        day = string_to_date(date_str, "%B %d, %Y")
3190
        imgs = soup.find('div', id='comic').find_all('img')
3191
        return {
3192
            'img': [i['src'] for i in imgs],
3193
            'title': title,
3194
            'month': day.month,
3195
            'year': day.year,
3196
            'day': day.day,
3197
        }
3198
3199
@@ 676-698 (lines=23) @@
673
        }
674
675
676
class PenelopeBagieu(GenericNavigableComic):
677
    """Class to retrieve comics from Penelope Bagieu's blog."""
678
    name = 'bagieu'
679
    long_name = 'Ma vie est tout a fait fascinante (Bagieu)'
680
    url = 'http://www.penelope-jolicoeur.com'
681
    _categories = ('FRANCAIS', )
682
    get_navi_link = get_link_rel_next
683
    get_first_comic_link = simulate_first_link
684
    first_url = 'http://www.penelope-jolicoeur.com/2007/02/ma-vie-mon-oeuv.html'
685
686
    @classmethod
687
    def get_comic_info(cls, soup, link):
688
        """Get information about a particular comics."""
689
        date_str = soup.find('h2', class_='date-header').string
690
        day = string_to_date(date_str, "%A %d %B %Y", "fr_FR.utf8")
691
        imgs = soup.find('div', class_='entry-body').find_all('img')
692
        title = soup.find('h3', class_='entry-header').string
693
        return {
694
            'title': title,
695
            'img': [i['src'] for i in imgs],
696
            'month': day.month,
697
            'year': day.year,
698
            'day': day.day,
699
        }
700
701
@@ 3446-3466 (lines=21) @@
3443
        }
3444
3445
3446
class Octopuns(GenericBlogspotComic):
3447
    """Class to retrieve Octopuns comics."""
3448
    # Also on http://octopuns.tumblr.com
3449
    name = 'octopuns'
3450
    long_name = 'Octopuns'
3451
    url = 'http://www.octopuns.net'  # or http://octopuns.blogspot.fr/
3452
    first_url = 'http://octopuns.blogspot.com/2010/12/17122010-always-read-label.html'
3453
3454
    @classmethod
3455
    def get_comic_info(cls, soup, link):
3456
        """Get information about a particular comics."""
3457
        title = soup.find('h3', class_='post-title entry-title').string
3458
        date_str = soup.find('h2', class_='date-header').string
3459
        day = string_to_date(date_str, "%A, %B %d, %Y")
3460
        imgs = soup.find_all('link', rel='image_src')
3461
        return {
3462
            'img': [i['href'] for i in imgs],
3463
            'title': title,
3464
            'day': day.day,
3465
            'month': day.month,
3466
            'year': day.year,
3467
        }
3468
3469
@@ 1694-1714 (lines=21) @@
1691
        }
1692
1693
1694
class WarehouseComic(GenericNavigableComic):
1695
    """Class to retrieve Warehouse Comic comics."""
1696
    name = 'warehouse'
1697
    long_name = 'Warehouse Comic'
1698
    url = 'http://warehousecomic.com'
1699
    get_first_comic_link = get_a_navi_navifirst
1700
    get_navi_link = get_link_rel_next
1701
1702
    @classmethod
1703
    def get_comic_info(cls, soup, link):
1704
        """Get information about a particular comics."""
1705
        title = soup.find('h2', class_='post-title').string
1706
        date_str = soup.find('span', class_='post-date').string
1707
        day = string_to_date(date_str, "%B %d, %Y")
1708
        imgs = soup.find('div', id='comic').find_all('img')
1709
        return {
1710
            'img': [i['src'] for i in imgs],
1711
            'title': title,
1712
            'day': day.day,
1713
            'month': day.month,
1714
            'year': day.year,
1715
        }
1716
1717
@@ 1212-1238 (lines=27) @@
1209
        }
1210
1211
1212
class ToonHole(GenericNavigableComic):
1213
    """Class to retrieve Toon Holes comics."""
1214
    # Also on http://tapastic.com/series/TOONHOLE
1215
    name = 'toonhole'
1216
    long_name = 'Toon Hole'
1217
    url = 'http://www.toonhole.com'
1218
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
1219
    get_navi_link = get_a_comicnavbase_comicnavnext
1220
1221
    @classmethod
1222
    def get_comic_info(cls, soup, link):
1223
        """Get information about a particular comics."""
1224
        date_str = soup.find('div', class_='entry-meta').contents[0].strip()
1225
        day = string_to_date(date_str, "%B %d, %Y")
1226
        imgs = soup.find('div', id='comic').find_all('img')
1227
        if imgs:
1228
            img = imgs[0]
1229
            title = img['alt']
1230
            assert img['title'] == title
1231
        else:
1232
            title = ""
1233
        return {
1234
            'title': title,
1235
            'month': day.month,
1236
            'year': day.year,
1237
            'day': day.day,
1238
            'img': [convert_iri_to_plain_ascii_uri(i['src']) for i in imgs],
1239
        }
1240
1241