Code Duplication    Length = 21-29 lines in 23 locations

comics.py 23 locations

@@ 1888-1914 (lines=27) @@
1885
1886
1887
class PicturesInBoxes(GenericNavigableComic):
1888
    """Class to retrieve Pictures In Boxes comics."""
1889
    # Also on https://picturesinboxescomic.tumblr.com
1890
    name = 'picturesinboxes'
1891
    long_name = 'Pictures in Boxes'
1892
    url = 'http://www.picturesinboxes.com'
1893
    get_navi_link = get_a_navi_navinext
1894
    get_first_comic_link = simulate_first_link
1895
    first_url = 'http://www.picturesinboxes.com/2013/10/26/tetris/'
1896
1897
    @classmethod
1898
    def get_comic_info(cls, soup, link):
1899
        """Get information about a particular comics."""
1900
        title = soup.find('h2', class_='post-title').string
1901
        author = soup.find("span", class_="post-author").find("a").string
1902
        date_str = soup.find('span', class_='post-date').string
1903
        day = string_to_date(date_str, '%B %d, %Y')
1904
        imgs = soup.find('div', class_='comicpane').find_all('img')
1905
        assert imgs
1906
        assert all(i['title'] == i['alt'] == title for i in imgs)
1907
        return {
1908
            'day': day.day,
1909
            'month': day.month,
1910
            'year': day.year,
1911
            'img': [i['src'] for i in imgs],
1912
            'title': title,
1913
            'author': author,
1914
        }
1915
1916
1917
class Penmen(GenericNavigableComic):
@@ 955-981 (lines=27) @@
952
            'day': day.day,
953
        }
954
955
956
class ImogenQuest(GenericNavigableComic):
957
    """Class to retrieve Imogen Quest comics."""
958
    # Also on http://imoquest.tumblr.com
959
    name = 'imogen'
960
    long_name = 'Imogen Quest'
961
    url = 'http://imogenquest.net'
962
    get_first_comic_link = get_div_navfirst_a
963
    get_navi_link = get_a_rel_next
964
965
    @classmethod
966
    def get_comic_info(cls, soup, link):
967
        """Get information about a particular comics."""
968
        title = soup.find('h2', class_='post-title').string
969
        author = soup.find("span", class_="post-author").find("a").string
970
        date_str = soup.find('span', class_='post-date').string
971
        day = string_to_date(date_str, '%B %d, %Y')
972
        imgs = soup.find('div', class_='comicpane').find_all('img')
973
        assert all(i['alt'] == i['title'] for i in imgs)
974
        title2 = imgs[0]['title']
975
        return {
976
            'day': day.day,
977
            'month': day.month,
978
            'year': day.year,
979
            'img': [i['src'] for i in imgs],
980
            'title': title,
981
            'title2': title2,
982
            'author': author,
983
        }
984
@@ 2589-2614 (lines=26) @@
2586
2587
class TheAwkwardYeti(GenericNavigableComic):
2588
    """Class to retrieve The Awkward Yeti comics."""
2589
    # Also on http://www.gocomics.com/the-awkward-yeti
2590
    # Also on http://larstheyeti.tumblr.com
2591
    # Also on https://tapastic.com/series/TheAwkwardYeti
2592
    name = 'yeti'
2593
    long_name = 'The Awkward Yeti'
2594
    url = 'http://theawkwardyeti.com'
2595
    _categories = ('YETI', )
2596
    get_first_comic_link = get_a_navi_navifirst
2597
    get_navi_link = get_link_rel_next
2598
2599
    @classmethod
2600
    def get_comic_info(cls, soup, link):
2601
        """Get information about a particular comics."""
2602
        title = soup.find('h2', class_='post-title').string
2603
        date_str = soup.find("span", class_="post-date").string
2604
        day = string_to_date(date_str, "%B %d, %Y")
2605
        imgs = soup.find("div", id="comic").find_all("img")
2606
        assert all(idx > 0 or i['alt'] == i['title'] for idx, i in enumerate(imgs))
2607
        return {
2608
            'img': [i['src'] for i in imgs],
2609
            'title': title,
2610
            'day': day.day,
2611
            'month': day.month,
2612
            'year': day.year
2613
        }
2614
2615
2616
class PleasantThoughts(GenericNavigableComic):
2617
    """Class to retrieve Pleasant Thoughts comics."""
@@ 2843-2867 (lines=25) @@
2840
2841
class GenericBoumerie(GenericNavigableComic):
2842
    """Generic class to retrieve Boumeries comics in different languages."""
2843
    get_first_comic_link = get_a_navi_navifirst
2844
    get_navi_link = get_link_rel_next
2845
    date_format = NotImplemented
2846
    lang = NotImplemented
2847
2848
    @classmethod
2849
    def get_comic_info(cls, soup, link):
2850
        """Get information about a particular comics."""
2851
        title = soup.find('h2', class_='post-title').string
2852
        short_url = soup.find('link', rel='shortlink')['href']
2853
        author = soup.find("span", class_="post-author").find("a").string
2854
        date_str = soup.find('span', class_='post-date').string
2855
        day = string_to_date(date_str, cls.date_format, cls.lang)
2856
        imgs = soup.find('div', id='comic').find_all('img')
2857
        assert all(i['alt'] == i['title'] for i in imgs)
2858
        return {
2859
            'short_url': short_url,
2860
            'img': [i['src'] for i in imgs],
2861
            'title': title,
2862
            'author': author,
2863
            'month': day.month,
2864
            'year': day.year,
2865
            'day': day.day,
2866
        }
2867
2868
2869
class BoumerieEn(GenericBoumerie):
2870
    """Class to retrieve Boumeries comics in English."""
@@ 2531-2555 (lines=25) @@
2528
2529
class EveryDayBlues(GenericDeletedComic, GenericNavigableComic):
2530
    """Class to retrieve EveryDayBlues Comics."""
2531
    name = "blues"
2532
    long_name = "Every Day Blues"
2533
    url = "http://everydayblues.net"
2534
    get_first_comic_link = get_a_navi_navifirst
2535
    get_navi_link = get_link_rel_next
2536
2537
    @classmethod
2538
    def get_comic_info(cls, soup, link):
2539
        """Get information about a particular comics."""
2540
        title = soup.find("h2", class_="post-title").string
2541
        author = soup.find("span", class_="post-author").find("a").string
2542
        date_str = soup.find("span", class_="post-date").string
2543
        day = string_to_date(date_str, "%d. %B %Y", "de_DE.utf8")
2544
        imgs = soup.find("div", id="comic").find_all("img")
2545
        assert all(i['alt'] == i['title'] == title for i in imgs)
2546
        assert len(imgs) <= 1
2547
        return {
2548
            'img': [i['src'] for i in imgs],
2549
            'title': title,
2550
            'author': author,
2551
            'day': day.day,
2552
            'month': day.month,
2553
            'year': day.year
2554
        }
2555
2556
2557
class BiterComics(GenericNavigableComic):
2558
    """Class to retrieve Biter Comics."""
@@ 1776-1800 (lines=25) @@
1773
1774
1775
class MouseBearComedy(GenericComicNotWorking):  # Website has changed
1776
    """Class to retrieve Mouse Bear Comedy comics."""
1777
    # Also on http://mousebearcomedy.tumblr.com
1778
    name = 'mousebear'
1779
    long_name = 'Mouse Bear Comedy'
1780
    url = 'http://www.mousebearcomedy.com'
1781
    get_first_comic_link = get_a_navi_navifirst
1782
    get_navi_link = get_a_navi_comicnavnext_navinext
1783
1784
    @classmethod
1785
    def get_comic_info(cls, soup, link):
1786
        """Get information about a particular comics."""
1787
        title = soup.find('h2', class_='post-title').string
1788
        author = soup.find("span", class_="post-author").find("a").string
1789
        date_str = soup.find("span", class_="post-date").string
1790
        day = string_to_date(date_str, '%B %d, %Y')
1791
        imgs = soup.find("div", id="comic").find_all("img")
1792
        assert all(i['alt'] == i['title'] == title for i in imgs)
1793
        return {
1794
            'day': day.day,
1795
            'month': day.month,
1796
            'year': day.year,
1797
            'img': [i['src'] for i in imgs],
1798
            'title': title,
1799
            'author': author,
1800
        }
1801
1802
1803
class BigFootJustice(GenericNavigableComic):
@@ 1184-1207 (lines=24) @@
1181
    long_name = 'Boulet Corp English'
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
@@ 701-724 (lines=24) @@
698
            'day': day.day,
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
@@ 929-951 (lines=23) @@
926
            'img': [i['src'] for i in imgs],
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
@@ 728-749 (lines=22) @@
725
            'img': [i['content'] for i in imgs],
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
        }
@@ 2700-2728 (lines=29) @@
2697
2698
class TalesOfAbsurdity(GenericNavigableComic):
2699
    """Class to retrieve Tales Of Absurdity comics."""
2700
    # Also on http://tapastic.com/series/Tales-Of-Absurdity
2701
    # Also on http://talesofabsurdity.tumblr.com
2702
    name = 'absurdity'
2703
    long_name = 'Tales of Absurdity'
2704
    url = 'http://talesofabsurdity.com'
2705
    _categories = ('ABSURDITY', )
2706
    get_first_comic_link = get_a_navi_navifirst
2707
    get_navi_link = get_a_navi_comicnavnext_navinext
2708
2709
    @classmethod
2710
    def get_comic_info(cls, soup, link):
2711
        """Get information about a particular comics."""
2712
        title = soup.find('h2', class_='post-title').string
2713
        author = soup.find("span", class_="post-author").find("a").string
2714
        date_str = soup.find("span", class_="post-date").string
2715
        day = string_to_date(date_str, "%B %d, %Y")
2716
        imgs = soup.find("div", id="comic").find_all("img")
2717
        assert all(i['alt'] == i['title'] for i in imgs)
2718
        alt = imgs[0]['alt'] if imgs else ""
2719
        return {
2720
            'img': [i['src'] for i in imgs],
2721
            'title': title,
2722
            'alt': alt,
2723
            'author': author,
2724
            'day': day.day,
2725
            'month': day.month,
2726
            'year': day.year
2727
        }
2728
2729
2730
class EndlessOrigami(GenericComicNotWorking, GenericNavigableComic):  # Nav not working
2731
    """Class to retrieve Endless Origami Comics."""
@@ 2638-2666 (lines=29) @@
2635
2636
class MisterAndMe(GenericNavigableComic):
2637
    """Class to retrieve Mister & Me Comics."""
2638
    # Also on http://www.gocomics.com/mister-and-me
2639
    # Also on https://tapastic.com/series/Mister-and-Me
2640
    name = 'mister'
2641
    long_name = 'Mister & Me'
2642
    url = 'http://www.mister-and-me.com'
2643
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2644
    get_navi_link = get_link_rel_next
2645
2646
    @classmethod
2647
    def get_comic_info(cls, soup, link):
2648
        """Get information about a particular comics."""
2649
        title = soup.find('h2', class_='post-title').string
2650
        author = soup.find("span", class_="post-author").find("a").string
2651
        date_str = soup.find("span", class_="post-date").string
2652
        day = string_to_date(date_str, "%B %d, %Y")
2653
        imgs = soup.find("div", id="comic").find_all("img")
2654
        assert all(i['alt'] == i['title'] for i in imgs)
2655
        assert len(imgs) <= 1
2656
        alt = imgs[0]['alt'] if imgs else ""
2657
        return {
2658
            'img': [i['src'] for i in imgs],
2659
            'title': title,
2660
            'alt': alt,
2661
            'author': author,
2662
            'day': day.day,
2663
            'month': day.month,
2664
            'year': day.year
2665
        }
2666
2667
2668
class LastPlaceComics(GenericNavigableComic):
2669
    """Class to retrieve Last Place Comics."""
@@ 2924-2950 (lines=27) @@
2921
2922
class Optipess(GenericNavigableComic):
2923
    """Class to retrieve Optipess comics."""
2924
    name = 'optipess'
2925
    long_name = 'Optipess'
2926
    url = 'http://www.optipess.com'
2927
    get_first_comic_link = get_a_navi_navifirst
2928
    get_navi_link = get_link_rel_next
2929
2930
    @classmethod
2931
    def get_comic_info(cls, soup, link):
2932
        """Get information about a particular comics."""
2933
        title = soup.find('h2', class_='post-title').string
2934
        author = soup.find("span", class_="post-author").find("a").string
2935
        comic = soup.find('div', id='comic')
2936
        imgs = comic.find_all('img') if comic else []
2937
        alt = imgs[0]['title'] if imgs else ""
2938
        assert all(i['alt'] == i['title'] == alt for i in imgs)
2939
        date_str = soup.find('span', class_='post-date').string
2940
        day = string_to_date(date_str, "%B %d, %Y")
2941
        return {
2942
            'title': title,
2943
            'alt': alt,
2944
            'author': author,
2945
            'img': [i['src'] for i in imgs],
2946
            'month': day.month,
2947
            'year': day.year,
2948
            'day': day.day,
2949
        }
2950
2951
2952
class PainTrainComic(GenericNavigableComic):
2953
    """Class to retrieve Pain Train Comics."""
@@ 2559-2585 (lines=27) @@
2556
2557
class BiterComics(GenericNavigableComic):
2558
    """Class to retrieve Biter Comics."""
2559
    name = "biter"
2560
    long_name = "Biter Comics"
2561
    url = "http://www.bitercomics.com"
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("h1", class_="entry-title").string
2569
        author = soup.find("span", class_="author vcard").find("a").string
2570
        date_str = soup.find("span", class_="entry-date").string
2571
        day = string_to_date(date_str, "%B %d, %Y")
2572
        imgs = soup.find("div", id="comic").find_all("img")
2573
        assert all(i['alt'] == i['title'] for i in imgs)
2574
        assert len(imgs) == 1
2575
        alt = imgs[0]['alt']
2576
        return {
2577
            'img': [i['src'] for i in imgs],
2578
            'title': title,
2579
            'alt': alt,
2580
            'author': author,
2581
            'day': day.day,
2582
            'month': day.month,
2583
            'year': day.year
2584
        }
2585
2586
2587
class TheAwkwardYeti(GenericNavigableComic):
2588
    """Class to retrieve The Awkward Yeti comics."""
@@ 2033-2059 (lines=27) @@
2030
2031
2032
class CompletelySeriousComics(GenericNavigableComic):
2033
    """Class to retrieve Completely Serious comics."""
2034
    name = 'completelyserious'
2035
    long_name = 'Completely Serious Comics'
2036
    url = 'http://completelyseriouscomics.com'
2037
    get_first_comic_link = get_a_navi_navifirst
2038
    get_navi_link = get_a_navi_navinext
2039
2040
    @classmethod
2041
    def get_comic_info(cls, soup, link):
2042
        """Get information about a particular comics."""
2043
        title = soup.find('h2', class_='post-title').string
2044
        author = soup.find('span', class_='post-author').contents[1].string
2045
        date_str = soup.find('span', class_='post-date').string
2046
        day = string_to_date(date_str, '%B %d, %Y')
2047
        imgs = soup.find('div', class_='comicpane').find_all('img')
2048
        assert imgs
2049
        alt = imgs[0]['title']
2050
        assert all(i['title'] == i['alt'] == alt for i in imgs)
2051
        return {
2052
            'month': day.month,
2053
            'year': day.year,
2054
            'day': day.day,
2055
            'img': [i['src'] for i in imgs],
2056
            'title': title,
2057
            'alt': alt,
2058
            'author': author,
2059
        }
2060
2061
2062
class PoorlyDrawnLines(GenericListableComic):
@@ 2732-2757 (lines=26) @@
2729
2730
class EndlessOrigami(GenericComicNotWorking, GenericNavigableComic):  # Nav not working
2731
    """Class to retrieve Endless Origami Comics."""
2732
    name = "origami"
2733
    long_name = "Endless Origami"
2734
    url = "http://endlessorigami.com"
2735
    get_first_comic_link = get_a_navi_navifirst
2736
    get_navi_link = get_link_rel_next
2737
2738
    @classmethod
2739
    def get_comic_info(cls, soup, link):
2740
        """Get information about a particular comics."""
2741
        title = soup.find('h2', class_='post-title').string
2742
        author = soup.find("span", class_="post-author").find("a").string
2743
        date_str = soup.find("span", class_="post-date").string
2744
        day = string_to_date(date_str, "%B %d, %Y")
2745
        imgs = soup.find("div", id="comic").find_all("img")
2746
        assert all(i['alt'] == i['title'] for i in imgs)
2747
        alt = imgs[0]['alt'] if imgs else ""
2748
        return {
2749
            'img': [i['src'] for i in imgs],
2750
            'title': title,
2751
            'alt': alt,
2752
            'author': author,
2753
            'day': day.day,
2754
            'month': day.month,
2755
            'year': day.year
2756
        }
2757
2758
2759
class PlanC(GenericNavigableComic):
2760
    """Class to retrieve Plan C comics."""
@@ 2245-2270 (lines=26) @@
2242
2243
class HappleTea(GenericNavigableComic):
2244
    """Class to retrieve Happle Tea Comics."""
2245
    name = 'happletea'
2246
    long_name = 'Happle Tea'
2247
    url = 'http://www.happletea.com'
2248
    get_first_comic_link = get_a_navi_navifirst
2249
    get_navi_link = get_link_rel_next
2250
2251
    @classmethod
2252
    def get_comic_info(cls, soup, link):
2253
        """Get information about a particular comics."""
2254
        imgs = soup.find('div', id='comic').find_all('img')
2255
        post = soup.find('div', class_='post-content')
2256
        title = post.find('h2', class_='post-title').string
2257
        author = post.find('a', rel='author').string
2258
        date_str = post.find('span', class_='post-date').string
2259
        day = string_to_date(date_str, "%B %d, %Y")
2260
        assert all(i['alt'] == i['title'] for i in imgs)
2261
        return {
2262
            'title': title,
2263
            'img': [i['src'] for i in imgs],
2264
            'alt': ''.join(i['alt'] for i in imgs),
2265
            'month': day.month,
2266
            'year': day.year,
2267
            'day': day.day,
2268
            'author': author,
2269
        }
2270
2271
2272
class RockPaperScissors(GenericNavigableComic):
2273
    """Class to retrieve Rock Paper Scissors comics."""
@@ 1918-1943 (lines=26) @@
1915
1916
1917
class Penmen(GenericNavigableComic):
1918
    """Class to retrieve Penmen comics."""
1919
    name = 'penmen'
1920
    long_name = 'Penmen'
1921
    url = 'http://penmen.com'
1922
    get_navi_link = get_link_rel_next
1923
    get_first_comic_link = simulate_first_link
1924
    first_url = 'http://penmen.com/index.php/2016/09/12/penmen-announces-grin-big-brand-clothing/'
1925
1926
    @classmethod
1927
    def get_comic_info(cls, soup, link):
1928
        """Get information about a particular comics."""
1929
        title = soup.find('title').string
1930
        imgs = soup.find('div', class_='entry-content').find_all('img')
1931
        short_url = soup.find('link', rel='shortlink')['href']
1932
        tags = ' '.join(t.string for t in soup.find_all('a', rel='tag'))
1933
        date_str = soup.find('time')['datetime'][:10]
1934
        day = string_to_date(date_str, "%Y-%m-%d")
1935
        return {
1936
            'title': title,
1937
            'short_url': short_url,
1938
            'img': [i['src'] for i in imgs],
1939
            'tags': tags,
1940
            'month': day.month,
1941
            'year': day.year,
1942
            'day': day.day,
1943
        }
1944
1945
1946
class TheDoghouseDiaries(GenericDeletedComic, GenericNavigableComic):
@@ 2401-2425 (lines=25) @@
2398
2399
class LonnieMillsap(GenericNavigableComic):
2400
    """Class to retrieve Lonnie Millsap's comics."""
2401
    name = 'millsap'
2402
    long_name = 'Lonnie Millsap'
2403
    url = 'http://www.lonniemillsap.com'
2404
    get_navi_link = get_link_rel_next
2405
    get_first_comic_link = simulate_first_link
2406
    first_url = 'http://www.lonniemillsap.com/?p=42'
2407
2408
    @classmethod
2409
    def get_comic_info(cls, soup, link):
2410
        """Get information about a particular comics."""
2411
        title = soup.find('h2', class_='post-title').string
2412
        post = soup.find('div', class_='post-content')
2413
        author = post.find("span", class_="post-author").find("a").string
2414
        date_str = post.find("span", class_="post-date").string
2415
        day = string_to_date(date_str, "%B %d, %Y")
2416
        imgs = post.find("div", class_="entry").find_all("img")
2417
        return {
2418
            'title': title,
2419
            'author': author,
2420
            'img': [i['src'] for i in imgs],
2421
            'month': day.month,
2422
            'year': day.year,
2423
            'day': day.day,
2424
        }
2425
2426
2427
class LinsEditions(GenericNavigableComic):
2428
    """Class to retrieve L.I.N.S. Editions comics."""
@@ 2121-2145 (lines=25) @@
2118
2119
2120
class ChuckleADuck(GenericNavigableComic):
2121
    """Class to retrieve Chuckle-A-Duck comics."""
2122
    name = 'chuckleaduck'
2123
    long_name = 'Chuckle-A-duck'
2124
    url = 'http://chuckleaduck.com'
2125
    get_first_comic_link = get_div_navfirst_a
2126
    get_navi_link = get_link_rel_next
2127
2128
    @classmethod
2129
    def get_comic_info(cls, soup, link):
2130
        """Get information about a particular comics."""
2131
        date_str = soup.find('span', class_='post-date').string
2132
        day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y")
2133
        author = soup.find('span', class_='post-author').string
2134
        div = soup.find('div', id='comic')
2135
        imgs = div.find_all('img') if div else []
2136
        title = imgs[0]['title'] if imgs else ""
2137
        assert all(i['title'] == i['alt'] == title for i in imgs)
2138
        return {
2139
            'month': day.month,
2140
            'year': day.year,
2141
            'day': day.day,
2142
            'img': [i['src'] for i in imgs],
2143
            'title': title,
2144
            'author': author,
2145
        }
2146
2147
2148
class DepressedAlien(GenericNavigableComic):
@@ 3242-3265 (lines=24) @@
3239
    get_url_from_link = join_cls_url_to_href
3240
    get_first_comic_link = simulate_first_link
3241
    first_url = 'http://www.earthexplodes.com/comics/000/'
3242
3243
    @classmethod
3244
    def get_navi_link(cls, last_soup, next_):
3245
        """Get link to next or previous comic."""
3246
        return last_soup.find('a', id='next' if next_ else 'prev')
3247
3248
    @classmethod
3249
    def get_comic_info(cls, soup, link):
3250
        """Get information about a particular comics."""
3251
        title = soup.find('title').string
3252
        imgs = soup.find('div', id='image').find_all('img')
3253
        alt = imgs[0].get('title', '')
3254
        return {
3255
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
3256
            'title': title,
3257
            'alt': alt,
3258
        }
3259
3260
3261
class PomComics(GenericNavigableComic):
3262
    """Class to retrieve PomComics."""
3263
    name = 'pom'
3264
    long_name = 'Pom Comics / Piece of Me'
3265
    url = 'http://www.pomcomic.com'
3266
    get_url_from_link = join_cls_url_to_href
3267
3268
    @classmethod
@@ 675-697 (lines=23) @@
672
            'tags': tags,
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
@@ 2761-2781 (lines=21) @@
2758
2759
class PlanC(GenericNavigableComic):
2760
    """Class to retrieve Plan C comics."""
2761
    name = 'planc'
2762
    long_name = 'Plan C'
2763
    url = 'http://www.plancomic.com'
2764
    get_first_comic_link = get_a_navi_navifirst
2765
    get_navi_link = get_a_navi_comicnavnext_navinext
2766
2767
    @classmethod
2768
    def get_comic_info(cls, soup, link):
2769
        """Get information about a particular comics."""
2770
        title = soup.find('h2', class_='post-title').string
2771
        date_str = soup.find("span", class_="post-date").string
2772
        day = string_to_date(date_str, "%B %d, %Y")
2773
        imgs = soup.find('div', id='comic').find_all('img')
2774
        return {
2775
            'title': title,
2776
            'img': [i['src'] for i in imgs],
2777
            'month': day.month,
2778
            'year': day.year,
2779
            'day': day.day,
2780
        }
2781
2782
2783
class BuniComic(GenericNavigableComic):
2784
    """Class to retrieve Buni Comics."""