@@ 1861-1887 (lines=27) @@ | ||
1858 | } |
|
1859 | ||
1860 | ||
1861 | class PicturesInBoxes(GenericNavigableComic): |
|
1862 | """Class to retrieve Pictures In Boxes comics.""" |
|
1863 | # Also on https://picturesinboxescomic.tumblr.com |
|
1864 | name = 'picturesinboxes' |
|
1865 | long_name = 'Pictures in Boxes' |
|
1866 | url = 'http://www.picturesinboxes.com' |
|
1867 | get_navi_link = get_a_navi_navinext |
|
1868 | get_first_comic_link = simulate_first_link |
|
1869 | first_url = 'http://www.picturesinboxes.com/2013/10/26/tetris/' |
|
1870 | ||
1871 | @classmethod |
|
1872 | def get_comic_info(cls, soup, link): |
|
1873 | """Get information about a particular comics.""" |
|
1874 | title = soup.find('h2', class_='post-title').string |
|
1875 | author = soup.find("span", class_="post-author").find("a").string |
|
1876 | date_str = soup.find('span', class_='post-date').string |
|
1877 | day = string_to_date(date_str, '%B %d, %Y') |
|
1878 | imgs = soup.find('div', class_='comicpane').find_all('img') |
|
1879 | assert imgs |
|
1880 | assert all(i['title'] == i['alt'] == title for i in imgs) |
|
1881 | return { |
|
1882 | 'day': day.day, |
|
1883 | 'month': day.month, |
|
1884 | 'year': day.year, |
|
1885 | 'img': [i['src'] for i in imgs], |
|
1886 | 'title': title, |
|
1887 | 'author': author, |
|
1888 | } |
|
1889 | ||
1890 | ||
@@ 928-954 (lines=27) @@ | ||
925 | } |
|
926 | ||
927 | ||
928 | class ImogenQuest(GenericNavigableComic): |
|
929 | """Class to retrieve Imogen Quest comics.""" |
|
930 | # Also on http://imoquest.tumblr.com |
|
931 | name = 'imogen' |
|
932 | long_name = 'Imogen Quest' |
|
933 | url = 'http://imogenquest.net' |
|
934 | get_first_comic_link = get_div_navfirst_a |
|
935 | get_navi_link = get_a_rel_next |
|
936 | ||
937 | @classmethod |
|
938 | def get_comic_info(cls, soup, link): |
|
939 | """Get information about a particular comics.""" |
|
940 | title = soup.find('h2', class_='post-title').string |
|
941 | author = soup.find("span", class_="post-author").find("a").string |
|
942 | date_str = soup.find('span', class_='post-date').string |
|
943 | day = string_to_date(date_str, '%B %d, %Y') |
|
944 | imgs = soup.find('div', class_='comicpane').find_all('img') |
|
945 | assert all(i['alt'] == i['title'] for i in imgs) |
|
946 | title2 = imgs[0]['title'] |
|
947 | return { |
|
948 | 'day': day.day, |
|
949 | 'month': day.month, |
|
950 | 'year': day.year, |
|
951 | 'img': [i['src'] for i in imgs], |
|
952 | 'title': title, |
|
953 | 'title2': title2, |
|
954 | 'author': author, |
|
955 | } |
|
956 | ||
957 | ||
@@ 2534-2559 (lines=26) @@ | ||
2531 | ||
2532 | class BiterComics(GenericNavigableComic): |
|
2533 | """Class to retrieve Biter Comics.""" |
|
2534 | name = "biter" |
|
2535 | long_name = "Biter Comics" |
|
2536 | url = "http://www.bitercomics.com" |
|
2537 | get_first_comic_link = get_a_navi_navifirst |
|
2538 | get_navi_link = get_link_rel_next |
|
2539 | ||
2540 | @classmethod |
|
2541 | def get_comic_info(cls, soup, link): |
|
2542 | """Get information about a particular comics.""" |
|
2543 | title = soup.find("h1", class_="entry-title").string |
|
2544 | author = soup.find("span", class_="author vcard").find("a").string |
|
2545 | date_str = soup.find("span", class_="entry-date").string |
|
2546 | day = string_to_date(date_str, "%B %d, %Y") |
|
2547 | imgs = soup.find("div", id="comic").find_all("img") |
|
2548 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2549 | assert len(imgs) == 1 |
|
2550 | alt = imgs[0]['alt'] |
|
2551 | return { |
|
2552 | 'img': [i['src'] for i in imgs], |
|
2553 | 'title': title, |
|
2554 | 'alt': alt, |
|
2555 | 'author': author, |
|
2556 | 'day': day.day, |
|
2557 | 'month': day.month, |
|
2558 | 'year': day.year |
|
2559 | } |
|
2560 | ||
2561 | ||
2562 | class TheAwkwardYeti(GenericNavigableComic): |
|
@@ 2788-2812 (lines=25) @@ | ||
2785 | def get_comic_info(cls, soup, link): |
|
2786 | """Get information about a particular comics.""" |
|
2787 | desc = soup.find('meta', property='og:description')['content'] |
|
2788 | title = soup.find('meta', property='og:title')['content'] |
|
2789 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
2790 | title2 = ' '.join(i.get('title', '') for i in imgs) |
|
2791 | return { |
|
2792 | 'title': title, |
|
2793 | 'title2': title2, |
|
2794 | 'description': desc, |
|
2795 | 'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
|
2796 | } |
|
2797 | ||
2798 | ||
2799 | class CommitStripFr(GenericCommitStrip): |
|
2800 | """Class to retrieve Commit Strips in French.""" |
|
2801 | name = 'commit_fr' |
|
2802 | long_name = 'Commit Strip (Fr)' |
|
2803 | url = 'http://www.commitstrip.com/fr' |
|
2804 | _categories = ('FRANCAIS', ) |
|
2805 | first_url = 'http://www.commitstrip.com/fr/2012/02/22/interview/' |
|
2806 | ||
2807 | ||
2808 | class CommitStripEn(GenericCommitStrip): |
|
2809 | """Class to retrieve Commit Strips in English.""" |
|
2810 | name = 'commit_en' |
|
2811 | long_name = 'Commit Strip (En)' |
|
2812 | url = 'http://www.commitstrip.com/en' |
|
2813 | first_url = 'http://www.commitstrip.com/en/2012/02/22/interview/' |
|
2814 | ||
2815 | ||
@@ 2476-2500 (lines=25) @@ | ||
2473 | ||
2474 | ||
2475 | class GerbilWithAJetpack(GenericNavigableComic): |
|
2476 | """Class to retrieve GerbilWithAJetpack comics.""" |
|
2477 | name = 'gerbil' |
|
2478 | long_name = 'Gerbil With A Jetpack' |
|
2479 | url = 'http://gerbilwithajetpack.com' |
|
2480 | get_first_comic_link = get_a_navi_navifirst |
|
2481 | get_navi_link = get_a_rel_next |
|
2482 | ||
2483 | @classmethod |
|
2484 | def get_comic_info(cls, soup, link): |
|
2485 | """Get information about a particular comics.""" |
|
2486 | title = soup.find('h2', class_='post-title').string |
|
2487 | author = soup.find("span", class_="post-author").find("a").string |
|
2488 | date_str = soup.find("span", class_="post-date").string |
|
2489 | day = string_to_date(date_str, "%B %d, %Y") |
|
2490 | imgs = soup.find("div", id="comic").find_all("img") |
|
2491 | alt = imgs[0]['alt'] |
|
2492 | assert all(i['alt'] == i['title'] == alt for i in imgs) |
|
2493 | return { |
|
2494 | 'img': [i['src'] for i in imgs], |
|
2495 | 'title': title, |
|
2496 | 'alt': alt, |
|
2497 | 'author': author, |
|
2498 | 'day': day.day, |
|
2499 | 'month': day.month, |
|
2500 | 'year': day.year |
|
2501 | } |
|
2502 | ||
2503 | ||
@@ 1749-1773 (lines=25) @@ | ||
1746 | } |
|
1747 | ||
1748 | ||
1749 | class MouseBearComedy(GenericNavigableComic): |
|
1750 | """Class to retrieve Mouse Bear Comedy comics.""" |
|
1751 | # Also on http://mousebearcomedy.tumblr.com |
|
1752 | name = 'mousebear' |
|
1753 | long_name = 'Mouse Bear Comedy' |
|
1754 | url = 'http://www.mousebearcomedy.com' |
|
1755 | get_first_comic_link = get_a_navi_navifirst |
|
1756 | get_navi_link = get_a_navi_comicnavnext_navinext |
|
1757 | ||
1758 | @classmethod |
|
1759 | def get_comic_info(cls, soup, link): |
|
1760 | """Get information about a particular comics.""" |
|
1761 | title = soup.find('h2', class_='post-title').string |
|
1762 | author = soup.find("span", class_="post-author").find("a").string |
|
1763 | date_str = soup.find("span", class_="post-date").string |
|
1764 | day = string_to_date(date_str, '%B %d, %Y') |
|
1765 | imgs = soup.find("div", id="comic").find_all("img") |
|
1766 | assert all(i['alt'] == i['title'] == title for i in imgs) |
|
1767 | return { |
|
1768 | 'day': day.day, |
|
1769 | 'month': day.month, |
|
1770 | 'year': day.year, |
|
1771 | 'img': [i['src'] for i in imgs], |
|
1772 | 'title': title, |
|
1773 | 'author': author, |
|
1774 | } |
|
1775 | ||
1776 | ||
@@ 1157-1180 (lines=24) @@ | ||
1154 | url = 'http://english.bouletcorp.com' |
|
1155 | ||
1156 | ||
1157 | class AmazingSuperPowers(GenericNavigableComic): |
|
1158 | """Class to retrieve Amazing Super Powers comics.""" |
|
1159 | name = 'asp' |
|
1160 | long_name = 'Amazing Super Powers' |
|
1161 | url = 'http://www.amazingsuperpowers.com' |
|
1162 | get_first_comic_link = get_a_navi_navifirst |
|
1163 | get_navi_link = get_a_navi_navinext |
|
1164 | ||
1165 | @classmethod |
|
1166 | def get_comic_info(cls, soup, link): |
|
1167 | """Get information about a particular comics.""" |
|
1168 | author = soup.find("span", class_="post-author").find("a").string |
|
1169 | date_str = soup.find('span', class_='post-date').string |
|
1170 | day = string_to_date(date_str, "%B %d, %Y") |
|
1171 | imgs = soup.find('div', id='comic').find_all('img') |
|
1172 | title = ' '.join(i['title'] for i in imgs) |
|
1173 | assert all(i['alt'] == i['title'] for i in imgs) |
|
1174 | return { |
|
1175 | 'title': title, |
|
1176 | 'author': author, |
|
1177 | 'img': [img['src'] for img in imgs], |
|
1178 | 'day': day.day, |
|
1179 | 'month': day.month, |
|
1180 | 'year': day.year |
|
1181 | } |
|
1182 | ||
1183 | ||
@@ 674-697 (lines=24) @@ | ||
671 | } |
|
672 | ||
673 | ||
674 | class OneOneOneOneComic(GenericEmptyComic, GenericNavigableComic): |
|
675 | """Class to retrieve 1111 Comics.""" |
|
676 | # Also on http://comics1111.tumblr.com |
|
677 | # Also on https://tapastic.com/series/1111-Comics |
|
678 | name = '1111' |
|
679 | long_name = '1111 Comics' |
|
680 | url = 'http://www.1111comics.me' |
|
681 | _categories = ('ONEONEONEONE', ) |
|
682 | get_first_comic_link = get_div_navfirst_a |
|
683 | get_navi_link = get_link_rel_next |
|
684 | ||
685 | @classmethod |
|
686 | def get_comic_info(cls, soup, link): |
|
687 | """Get information about a particular comics.""" |
|
688 | title = soup.find('h1', class_='comic-title').find('a').string |
|
689 | date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string |
|
690 | day = string_to_date(date_str, "%B %d, %Y") |
|
691 | imgs = soup.find_all('meta', property='og:image') |
|
692 | return { |
|
693 | 'title': title, |
|
694 | 'month': day.month, |
|
695 | 'year': day.year, |
|
696 | 'day': day.day, |
|
697 | 'img': [i['content'] for i in imgs], |
|
698 | } |
|
699 | ||
700 | ||
@@ 902-924 (lines=23) @@ | ||
899 | } |
|
900 | ||
901 | ||
902 | class TheGentlemanArmchair(GenericNavigableComic): |
|
903 | """Class to retrieve The Gentleman Armchair comics.""" |
|
904 | name = 'gentlemanarmchair' |
|
905 | long_name = 'The Gentleman Armchair' |
|
906 | url = 'http://thegentlemansarmchair.com' |
|
907 | get_first_comic_link = get_a_navi_navifirst |
|
908 | get_navi_link = get_link_rel_next |
|
909 | ||
910 | @classmethod |
|
911 | def get_comic_info(cls, soup, link): |
|
912 | """Get information about a particular comics.""" |
|
913 | title = soup.find('h2', class_='post-title').string |
|
914 | author = soup.find("span", class_="post-author").find("a").string |
|
915 | date_str = soup.find('span', class_='post-date').string |
|
916 | day = string_to_date(date_str, "%B %d, %Y") |
|
917 | imgs = soup.find('div', id='comic').find_all('img') |
|
918 | return { |
|
919 | 'img': [i['src'] for i in imgs], |
|
920 | 'title': title, |
|
921 | 'author': author, |
|
922 | 'month': day.month, |
|
923 | 'year': day.year, |
|
924 | 'day': day.day, |
|
925 | } |
|
926 | ||
927 | ||
@@ 701-722 (lines=22) @@ | ||
698 | } |
|
699 | ||
700 | ||
701 | class AngryAtNothing(GenericEmptyComic, GenericNavigableComic): |
|
702 | """Class to retrieve Angry at Nothing comics.""" |
|
703 | # Also on http://tapastic.com/series/Comics-yeah-definitely-comics- |
|
704 | # Also on http://angryatnothing.tumblr.com |
|
705 | name = 'angry' |
|
706 | long_name = 'Angry At Nothing' |
|
707 | url = 'http://www.angryatnothing.net' |
|
708 | get_first_comic_link = get_div_navfirst_a |
|
709 | get_navi_link = get_a_rel_next |
|
710 | ||
711 | @classmethod |
|
712 | def get_comic_info(cls, soup, link): |
|
713 | """Get information about a particular comics.""" |
|
714 | title = soup.find('h1', class_='comic-title').find('a').string |
|
715 | date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string |
|
716 | day = string_to_date(date_str, "%B %d, %Y") |
|
717 | imgs = soup.find_all('meta', property='og:image') |
|
718 | return { |
|
719 | 'title': title, |
|
720 | 'month': day.month, |
|
721 | 'year': day.year, |
|
722 | 'day': day.day, |
|
723 | 'img': [i['content'] for i in imgs], |
|
724 | } |
|
725 | ||
@@ 2645-2673 (lines=29) @@ | ||
2642 | ||
2643 | class LastPlaceComics(GenericNavigableComic): |
|
2644 | """Class to retrieve Last Place Comics.""" |
|
2645 | name = 'lastplace' |
|
2646 | long_name = 'Last Place Comics' |
|
2647 | url = "http://lastplacecomics.com" |
|
2648 | get_first_comic_link = get_a_comicnavbase_comicnavfirst |
|
2649 | get_navi_link = get_link_rel_next |
|
2650 | ||
2651 | @classmethod |
|
2652 | def get_comic_info(cls, soup, link): |
|
2653 | """Get information about a particular comics.""" |
|
2654 | title = soup.find('h2', class_='post-title').string |
|
2655 | author = soup.find("span", class_="post-author").find("a").string |
|
2656 | date_str = soup.find("span", class_="post-date").string |
|
2657 | day = string_to_date(date_str, "%B %d, %Y") |
|
2658 | imgs = soup.find("div", id="comic").find_all("img") |
|
2659 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2660 | assert len(imgs) <= 1 |
|
2661 | alt = imgs[0]['alt'] if imgs else "" |
|
2662 | return { |
|
2663 | 'img': [i['src'] for i in imgs], |
|
2664 | 'title': title, |
|
2665 | 'alt': alt, |
|
2666 | 'author': author, |
|
2667 | 'day': day.day, |
|
2668 | 'month': day.month, |
|
2669 | 'year': day.year |
|
2670 | } |
|
2671 | ||
2672 | ||
2673 | class TalesOfAbsurdity(GenericNavigableComic): |
|
2674 | """Class to retrieve Tales Of Absurdity comics.""" |
|
2675 | # Also on http://tapastic.com/series/Tales-Of-Absurdity |
|
2676 | # Also on http://talesofabsurdity.tumblr.com |
|
@@ 2869-2895 (lines=27) @@ | ||
2866 | # Also on https://unearthedcomics.tumblr.com |
|
2867 | name = 'unearthed' |
|
2868 | long_name = 'Unearthed Comics' |
|
2869 | url = 'http://unearthedcomics.com' |
|
2870 | _categories = ('UNEARTHED', ) |
|
2871 | get_navi_link = get_link_rel_next |
|
2872 | get_first_comic_link = simulate_first_link |
|
2873 | first_url = 'http://unearthedcomics.com/comics/world-with-turn-signals/' |
|
2874 | ||
2875 | @classmethod |
|
2876 | def get_comic_info(cls, soup, link): |
|
2877 | """Get information about a particular comics.""" |
|
2878 | short_url = soup.find('link', rel='shortlink')['href'] |
|
2879 | title_elt = soup.find('h1') or soup.find('h2') |
|
2880 | title = title_elt.string if title_elt else "" |
|
2881 | desc = soup.find('meta', property='og:description') |
|
2882 | date_str = soup.find('time', class_='published updated hidden')['datetime'] |
|
2883 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2884 | post = soup.find('div', class_="entry content entry-content type-portfolio") |
|
2885 | imgs = post.find_all('img') |
|
2886 | return { |
|
2887 | 'title': title, |
|
2888 | 'description': desc, |
|
2889 | 'url2': short_url, |
|
2890 | 'img': [i['src'] for i in imgs], |
|
2891 | 'month': day.month, |
|
2892 | 'year': day.year, |
|
2893 | 'day': day.day, |
|
2894 | } |
|
2895 | ||
2896 | ||
2897 | class Optipess(GenericNavigableComic): |
|
2898 | """Class to retrieve Optipess comics.""" |
|
@@ 2504-2530 (lines=27) @@ | ||
2501 | } |
|
2502 | ||
2503 | ||
2504 | class EveryDayBlues(GenericEmptyComic, GenericNavigableComic): |
|
2505 | """Class to retrieve EveryDayBlues Comics.""" |
|
2506 | name = "blues" |
|
2507 | long_name = "Every Day Blues" |
|
2508 | url = "http://everydayblues.net" |
|
2509 | get_first_comic_link = get_a_navi_navifirst |
|
2510 | get_navi_link = get_link_rel_next |
|
2511 | ||
2512 | @classmethod |
|
2513 | def get_comic_info(cls, soup, link): |
|
2514 | """Get information about a particular comics.""" |
|
2515 | title = soup.find("h2", class_="post-title").string |
|
2516 | author = soup.find("span", class_="post-author").find("a").string |
|
2517 | date_str = soup.find("span", class_="post-date").string |
|
2518 | day = string_to_date(date_str, "%d. %B %Y", "de_DE.utf8") |
|
2519 | imgs = soup.find("div", id="comic").find_all("img") |
|
2520 | assert all(i['alt'] == i['title'] == title for i in imgs) |
|
2521 | assert len(imgs) <= 1 |
|
2522 | return { |
|
2523 | 'img': [i['src'] for i in imgs], |
|
2524 | 'title': title, |
|
2525 | 'author': author, |
|
2526 | 'day': day.day, |
|
2527 | 'month': day.month, |
|
2528 | 'year': day.year |
|
2529 | } |
|
2530 | ||
2531 | ||
2532 | class BiterComics(GenericNavigableComic): |
|
2533 | """Class to retrieve Biter Comics.""" |
|
@@ 2006-2032 (lines=27) @@ | ||
2003 | _categories = ('TUNEYTOONS', ) |
|
2004 | ||
2005 | ||
2006 | class CompletelySeriousComics(GenericNavigableComic): |
|
2007 | """Class to retrieve Completely Serious comics.""" |
|
2008 | name = 'completelyserious' |
|
2009 | long_name = 'Completely Serious Comics' |
|
2010 | url = 'http://completelyseriouscomics.com' |
|
2011 | get_first_comic_link = get_a_navi_navifirst |
|
2012 | get_navi_link = get_a_navi_navinext |
|
2013 | ||
2014 | @classmethod |
|
2015 | def get_comic_info(cls, soup, link): |
|
2016 | """Get information about a particular comics.""" |
|
2017 | title = soup.find('h2', class_='post-title').string |
|
2018 | author = soup.find('span', class_='post-author').contents[1].string |
|
2019 | date_str = soup.find('span', class_='post-date').string |
|
2020 | day = string_to_date(date_str, '%B %d, %Y') |
|
2021 | imgs = soup.find('div', class_='comicpane').find_all('img') |
|
2022 | assert imgs |
|
2023 | alt = imgs[0]['title'] |
|
2024 | assert all(i['title'] == i['alt'] == alt for i in imgs) |
|
2025 | return { |
|
2026 | 'month': day.month, |
|
2027 | 'year': day.year, |
|
2028 | 'day': day.day, |
|
2029 | 'img': [i['src'] for i in imgs], |
|
2030 | 'title': title, |
|
2031 | 'alt': alt, |
|
2032 | 'author': author, |
|
2033 | } |
|
2034 | ||
2035 | ||
@@ 2677-2702 (lines=26) @@ | ||
2674 | """Class to retrieve Tales Of Absurdity comics.""" |
|
2675 | # Also on http://tapastic.com/series/Tales-Of-Absurdity |
|
2676 | # Also on http://talesofabsurdity.tumblr.com |
|
2677 | name = 'absurdity' |
|
2678 | long_name = 'Tales of Absurdity' |
|
2679 | url = 'http://talesofabsurdity.com' |
|
2680 | _categories = ('ABSURDITY', ) |
|
2681 | get_first_comic_link = get_a_navi_navifirst |
|
2682 | get_navi_link = get_a_navi_comicnavnext_navinext |
|
2683 | ||
2684 | @classmethod |
|
2685 | def get_comic_info(cls, soup, link): |
|
2686 | """Get information about a particular comics.""" |
|
2687 | title = soup.find('h2', class_='post-title').string |
|
2688 | author = soup.find("span", class_="post-author").find("a").string |
|
2689 | date_str = soup.find("span", class_="post-date").string |
|
2690 | day = string_to_date(date_str, "%B %d, %Y") |
|
2691 | imgs = soup.find("div", id="comic").find_all("img") |
|
2692 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2693 | alt = imgs[0]['alt'] if imgs else "" |
|
2694 | return { |
|
2695 | 'img': [i['src'] for i in imgs], |
|
2696 | 'title': title, |
|
2697 | 'alt': alt, |
|
2698 | 'author': author, |
|
2699 | 'day': day.day, |
|
2700 | 'month': day.month, |
|
2701 | 'year': day.year |
|
2702 | } |
|
2703 | ||
2704 | ||
2705 | class EndlessOrigami(GenericEmptyComic, GenericNavigableComic): |
|
@@ 2218-2243 (lines=26) @@ | ||
2215 | return reversed(get_soup_at_url(archive_url).find('tbody').find_all('tr')) |
|
2216 | ||
2217 | ||
2218 | class HappleTea(GenericNavigableComic): |
|
2219 | """Class to retrieve Happle Tea Comics.""" |
|
2220 | name = 'happletea' |
|
2221 | long_name = 'Happle Tea' |
|
2222 | url = 'http://www.happletea.com' |
|
2223 | get_first_comic_link = get_a_navi_navifirst |
|
2224 | get_navi_link = get_link_rel_next |
|
2225 | ||
2226 | @classmethod |
|
2227 | def get_comic_info(cls, soup, link): |
|
2228 | """Get information about a particular comics.""" |
|
2229 | imgs = soup.find('div', id='comic').find_all('img') |
|
2230 | post = soup.find('div', class_='post-content') |
|
2231 | title = post.find('h2', class_='post-title').string |
|
2232 | author = post.find('a', rel='author').string |
|
2233 | date_str = post.find('span', class_='post-date').string |
|
2234 | day = string_to_date(date_str, "%B %d, %Y") |
|
2235 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2236 | return { |
|
2237 | 'title': title, |
|
2238 | 'img': [i['src'] for i in imgs], |
|
2239 | 'alt': ''.join(i['alt'] for i in imgs), |
|
2240 | 'month': day.month, |
|
2241 | 'year': day.year, |
|
2242 | 'day': day.day, |
|
2243 | 'author': author, |
|
2244 | } |
|
2245 | ||
2246 | ||
@@ 1891-1916 (lines=26) @@ | ||
1888 | } |
|
1889 | ||
1890 | ||
1891 | class Penmen(GenericNavigableComic): |
|
1892 | """Class to retrieve Penmen comics.""" |
|
1893 | name = 'penmen' |
|
1894 | long_name = 'Penmen' |
|
1895 | url = 'http://penmen.com' |
|
1896 | get_navi_link = get_link_rel_next |
|
1897 | get_first_comic_link = simulate_first_link |
|
1898 | first_url = 'http://penmen.com/index.php/2016/09/12/penmen-announces-grin-big-brand-clothing/' |
|
1899 | ||
1900 | @classmethod |
|
1901 | def get_comic_info(cls, soup, link): |
|
1902 | """Get information about a particular comics.""" |
|
1903 | title = soup.find('title').string |
|
1904 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
1905 | short_url = soup.find('link', rel='shortlink')['href'] |
|
1906 | tags = ' '.join(t.string for t in soup.find_all('a', rel='tag')) |
|
1907 | date_str = soup.find('time')['datetime'][:10] |
|
1908 | day = string_to_date(date_str, "%Y-%m-%d") |
|
1909 | return { |
|
1910 | 'title': title, |
|
1911 | 'short_url': short_url, |
|
1912 | 'img': [i['src'] for i in imgs], |
|
1913 | 'tags': tags, |
|
1914 | 'month': day.month, |
|
1915 | 'year': day.year, |
|
1916 | 'day': day.day, |
|
1917 | } |
|
1918 | ||
1919 | ||
@@ 1832-1857 (lines=26) @@ | ||
1829 | } |
|
1830 | ||
1831 | ||
1832 | class SafelyEndangered(GenericNavigableComic): |
|
1833 | """Class to retrieve Safely Endangered comics.""" |
|
1834 | # Also on http://tumblr.safelyendangered.com |
|
1835 | name = 'endangered' |
|
1836 | long_name = 'Safely Endangered' |
|
1837 | url = 'http://www.safelyendangered.com' |
|
1838 | get_navi_link = get_link_rel_next |
|
1839 | get_first_comic_link = simulate_first_link |
|
1840 | first_url = 'http://www.safelyendangered.com/comic/ignored/' |
|
1841 | ||
1842 | @classmethod |
|
1843 | def get_comic_info(cls, soup, link): |
|
1844 | """Get information about a particular comics.""" |
|
1845 | title = soup.find('h2', class_='post-title').string |
|
1846 | date_str = soup.find('span', class_='post-date').string |
|
1847 | day = string_to_date(date_str, '%B %d, %Y') |
|
1848 | imgs = soup.find('div', id='comic').find_all('img') |
|
1849 | alt = imgs[0]['alt'] |
|
1850 | assert all(i['alt'] == i['title'] for i in imgs) |
|
1851 | return { |
|
1852 | 'day': day.day, |
|
1853 | 'month': day.month, |
|
1854 | 'year': day.year, |
|
1855 | 'img': [i['src'] for i in imgs], |
|
1856 | 'title': title, |
|
1857 | 'alt': alt, |
|
1858 | } |
|
1859 | ||
1860 | ||
@@ 2346-2370 (lines=25) @@ | ||
2343 | ||
2344 | @classmethod |
|
2345 | def get_url_from_archive_element(cls, tr): |
|
2346 | """Get url corresponding to an archive element.""" |
|
2347 | _, td_comic, td_date, _ = tr.find_all('td') |
|
2348 | link = td_comic.find('a') |
|
2349 | return urljoin_wrapper(cls.url, link['href']) |
|
2350 | ||
2351 | @classmethod |
|
2352 | def get_comic_info(cls, soup, tr): |
|
2353 | """Get information about a particular comics.""" |
|
2354 | td_num, td_comic, td_date, _ = tr.find_all('td') |
|
2355 | num = int(td_num.string) |
|
2356 | link = td_comic.find('a') |
|
2357 | title = link.string |
|
2358 | imgs = soup.find_all('img', id='comic_image') |
|
2359 | date_str = td_date.string |
|
2360 | day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y, %I:%M %p") |
|
2361 | assert len(imgs) == 1 |
|
2362 | assert all(i.get('alt') == i.get('title') for i in imgs) |
|
2363 | return { |
|
2364 | 'num': num, |
|
2365 | 'title': title, |
|
2366 | 'alt': imgs[0].get('alt', ''), |
|
2367 | 'img': [i['src'] for i in imgs], |
|
2368 | 'month': day.month, |
|
2369 | 'year': day.year, |
|
2370 | 'day': day.day, |
|
2371 | } |
|
2372 | ||
2373 | ||
@@ 2094-2118 (lines=25) @@ | ||
2091 | } |
|
2092 | ||
2093 | ||
2094 | class ChuckleADuck(GenericNavigableComic): |
|
2095 | """Class to retrieve Chuckle-A-Duck comics.""" |
|
2096 | name = 'chuckleaduck' |
|
2097 | long_name = 'Chuckle-A-duck' |
|
2098 | url = 'http://chuckleaduck.com' |
|
2099 | get_first_comic_link = get_div_navfirst_a |
|
2100 | get_navi_link = get_link_rel_next |
|
2101 | ||
2102 | @classmethod |
|
2103 | def get_comic_info(cls, soup, link): |
|
2104 | """Get information about a particular comics.""" |
|
2105 | date_str = soup.find('span', class_='post-date').string |
|
2106 | day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y") |
|
2107 | author = soup.find('span', class_='post-author').string |
|
2108 | div = soup.find('div', id='comic') |
|
2109 | imgs = div.find_all('img') if div else [] |
|
2110 | title = imgs[0]['title'] if imgs else "" |
|
2111 | assert all(i['title'] == i['alt'] == title for i in imgs) |
|
2112 | return { |
|
2113 | 'month': day.month, |
|
2114 | 'year': day.year, |
|
2115 | 'day': day.day, |
|
2116 | 'img': [i['src'] for i in imgs], |
|
2117 | 'title': title, |
|
2118 | 'author': author, |
|
2119 | } |
|
2120 | ||
2121 | ||
@@ 3156-3179 (lines=24) @@ | ||
3153 | """Class to retrieve Sheldon comics.""" |
|
3154 | # Also on http://www.gocomics.com/sheldon |
|
3155 | name = 'sheldon' |
|
3156 | long_name = 'Sheldon Comics' |
|
3157 | url = 'http://www.sheldoncomics.com' |
|
3158 | ||
3159 | @classmethod |
|
3160 | def get_first_comic_link(cls): |
|
3161 | """Get link to first comics.""" |
|
3162 | return get_soup_at_url(cls.url).find("a", id="nav-first") |
|
3163 | ||
3164 | @classmethod |
|
3165 | def get_navi_link(cls, last_soup, next_): |
|
3166 | """Get link to next or previous comic.""" |
|
3167 | for link in last_soup.find_all("a", id="nav-next" if next_ else "nav-prev"): |
|
3168 | if link['href'] != 'http://www.sheldoncomics.com': |
|
3169 | return link |
|
3170 | return None |
|
3171 | ||
3172 | @classmethod |
|
3173 | def get_comic_info(cls, soup, link): |
|
3174 | """Get information about a particular comics.""" |
|
3175 | imgs = soup.find("div", id="comic-foot").find_all("img") |
|
3176 | assert all(i['alt'] == i['title'] for i in imgs) |
|
3177 | assert len(imgs) == 1 |
|
3178 | title = imgs[0]['title'] |
|
3179 | return { |
|
3180 | 'title': title, |
|
3181 | 'img': [i['src'] for i in imgs], |
|
3182 | } |
|
@@ 648-670 (lines=23) @@ | ||
645 | } |
|
646 | ||
647 | ||
648 | class PenelopeBagieu(GenericNavigableComic): |
|
649 | """Class to retrieve comics from Penelope Bagieu's blog.""" |
|
650 | name = 'bagieu' |
|
651 | long_name = 'Ma vie est tout a fait fascinante (Bagieu)' |
|
652 | url = 'http://www.penelope-jolicoeur.com' |
|
653 | _categories = ('FRANCAIS', ) |
|
654 | get_navi_link = get_link_rel_next |
|
655 | get_first_comic_link = simulate_first_link |
|
656 | first_url = 'http://www.penelope-jolicoeur.com/2007/02/ma-vie-mon-oeuv.html' |
|
657 | ||
658 | @classmethod |
|
659 | def get_comic_info(cls, soup, link): |
|
660 | """Get information about a particular comics.""" |
|
661 | date_str = soup.find('h2', class_='date-header').string |
|
662 | day = string_to_date(date_str, "%A %d %B %Y", "fr_FR.utf8") |
|
663 | imgs = soup.find('div', class_='entry-body').find_all('img') |
|
664 | title = soup.find('h3', class_='entry-header').string |
|
665 | return { |
|
666 | 'title': title, |
|
667 | 'img': [i['src'] for i in imgs], |
|
668 | 'month': day.month, |
|
669 | 'year': day.year, |
|
670 | 'day': day.day, |
|
671 | } |
|
672 | ||
673 | ||
@@ 1702-1722 (lines=21) @@ | ||
1699 | } |
|
1700 | ||
1701 | ||
1702 | class WarehouseComic(GenericNavigableComic): |
|
1703 | """Class to retrieve Warehouse Comic comics.""" |
|
1704 | name = 'warehouse' |
|
1705 | long_name = 'Warehouse Comic' |
|
1706 | url = 'http://warehousecomic.com' |
|
1707 | get_first_comic_link = get_a_navi_navifirst |
|
1708 | get_navi_link = get_link_rel_next |
|
1709 | ||
1710 | @classmethod |
|
1711 | def get_comic_info(cls, soup, link): |
|
1712 | """Get information about a particular comics.""" |
|
1713 | title = soup.find('h2', class_='post-title').string |
|
1714 | date_str = soup.find('span', class_='post-date').string |
|
1715 | day = string_to_date(date_str, "%B %d, %Y") |
|
1716 | imgs = soup.find('div', id='comic').find_all('img') |
|
1717 | return { |
|
1718 | 'img': [i['src'] for i in imgs], |
|
1719 | 'title': title, |
|
1720 | 'day': day.day, |
|
1721 | 'month': day.month, |
|
1722 | 'year': day.year, |
|
1723 | } |
|
1724 | ||
1725 | ||
@@ 2583-2611 (lines=29) @@ | ||
2580 | imgs = soup.find("div", id="comic").find_all("img") |
|
2581 | assert all(idx > 0 or i['alt'] == i['title'] for idx, i in enumerate(imgs)) |
|
2582 | return { |
|
2583 | 'img': [i['src'] for i in imgs], |
|
2584 | 'title': title, |
|
2585 | 'day': day.day, |
|
2586 | 'month': day.month, |
|
2587 | 'year': day.year |
|
2588 | } |
|
2589 | ||
2590 | ||
2591 | class PleasantThoughts(GenericNavigableComic): |
|
2592 | """Class to retrieve Pleasant Thoughts comics.""" |
|
2593 | name = 'pleasant' |
|
2594 | long_name = 'Pleasant Thoughts' |
|
2595 | url = 'http://pleasant-thoughts.com' |
|
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 | post = soup.find('div', class_='post-content') |
|
2603 | title = post.find('h2', class_='post-title').string |
|
2604 | imgs = post.find("div", class_="entry").find_all("img") |
|
2605 | return { |
|
2606 | 'title': title, |
|
2607 | 'img': [i['src'] for i in imgs], |
|
2608 | } |
|
2609 | ||
2610 | ||
2611 | class MisterAndMe(GenericNavigableComic): |
|
2612 | """Class to retrieve Mister & Me Comics.""" |
|
2613 | # Also on http://www.gocomics.com/mister-and-me |
|
2614 | # Also on https://tapastic.com/series/Mister-and-Me |