@@ 974-1000 (lines=27) @@ | ||
971 | } |
|
972 | ||
973 | ||
974 | class ImogenQuest(GenericNavigableComic): |
|
975 | """Class to retrieve Imogen Quest comics.""" |
|
976 | # Also on http://imoquest.tumblr.com |
|
977 | name = 'imogen' |
|
978 | long_name = 'Imogen Quest' |
|
979 | url = 'http://imogenquest.net' |
|
980 | get_first_comic_link = get_div_navfirst_a |
|
981 | get_navi_link = get_a_rel_next |
|
982 | ||
983 | @classmethod |
|
984 | def get_comic_info(cls, soup, link): |
|
985 | """Get information about a particular comics.""" |
|
986 | title = soup.find('h2', class_='post-title').string |
|
987 | author = soup.find("span", class_="post-author").find("a").string |
|
988 | date_str = soup.find('span', class_='post-date').string |
|
989 | day = string_to_date(date_str, '%B %d, %Y') |
|
990 | imgs = soup.find('div', class_='comicpane').find_all('img') |
|
991 | assert all(i['alt'] == i['title'] for i in imgs) |
|
992 | title2 = imgs[0]['title'] |
|
993 | return { |
|
994 | 'day': day.day, |
|
995 | 'month': day.month, |
|
996 | 'year': day.year, |
|
997 | 'img': [i['src'] for i in imgs], |
|
998 | 'title': title, |
|
999 | 'title2': title2, |
|
1000 | 'author': author, |
|
1001 | } |
|
1002 | ||
1003 | ||
@@ 1203-1226 (lines=24) @@ | ||
1200 | url = 'http://english.bouletcorp.com' |
|
1201 | ||
1202 | ||
1203 | class AmazingSuperPowers(GenericNavigableComic): |
|
1204 | """Class to retrieve Amazing Super Powers comics.""" |
|
1205 | name = 'asp' |
|
1206 | long_name = 'Amazing Super Powers' |
|
1207 | url = 'http://www.amazingsuperpowers.com' |
|
1208 | get_first_comic_link = get_a_navi_navifirst |
|
1209 | get_navi_link = get_a_navi_navinext |
|
1210 | ||
1211 | @classmethod |
|
1212 | def get_comic_info(cls, soup, link): |
|
1213 | """Get information about a particular comics.""" |
|
1214 | author = soup.find("span", class_="post-author").find("a").string |
|
1215 | date_str = soup.find('span', class_='post-date').string |
|
1216 | day = string_to_date(date_str, "%B %d, %Y") |
|
1217 | imgs = soup.find('div', id='comic').find_all('img') |
|
1218 | title = ' '.join(i['title'] for i in imgs) |
|
1219 | assert all(i['alt'] == i['title'] for i in imgs) |
|
1220 | return { |
|
1221 | 'title': title, |
|
1222 | 'author': author, |
|
1223 | 'img': [img['src'] for img in imgs], |
|
1224 | 'day': day.day, |
|
1225 | 'month': day.month, |
|
1226 | 'year': day.year |
|
1227 | } |
|
1228 | ||
1229 | ||
@@ 720-743 (lines=24) @@ | ||
717 | } |
|
718 | ||
719 | ||
720 | class OneOneOneOneComic(GenericComicNotWorking, GenericNavigableComic): |
|
721 | """Class to retrieve 1111 Comics.""" |
|
722 | # Also on http://comics1111.tumblr.com |
|
723 | # Also on https://tapastic.com/series/1111-Comics |
|
724 | name = '1111' |
|
725 | long_name = '1111 Comics' |
|
726 | url = 'http://www.1111comics.me' |
|
727 | _categories = ('ONEONEONEONE', ) |
|
728 | get_first_comic_link = get_div_navfirst_a |
|
729 | get_navi_link = get_link_rel_next |
|
730 | ||
731 | @classmethod |
|
732 | def get_comic_info(cls, soup, link): |
|
733 | """Get information about a particular comics.""" |
|
734 | title = soup.find('h1', class_='comic-title').find('a').string |
|
735 | date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string |
|
736 | day = string_to_date(date_str, "%B %d, %Y") |
|
737 | imgs = soup.find_all('meta', property='og:image') |
|
738 | return { |
|
739 | 'title': title, |
|
740 | 'month': day.month, |
|
741 | 'year': day.year, |
|
742 | 'day': day.day, |
|
743 | 'img': [i['content'] for i in imgs], |
|
744 | } |
|
745 | ||
746 | ||
@@ 948-970 (lines=23) @@ | ||
945 | } |
|
946 | ||
947 | ||
948 | class TheGentlemanArmchair(GenericNavigableComic): |
|
949 | """Class to retrieve The Gentleman Armchair comics.""" |
|
950 | name = 'gentlemanarmchair' |
|
951 | long_name = 'The Gentleman Armchair' |
|
952 | url = 'http://thegentlemansarmchair.com' |
|
953 | get_first_comic_link = get_a_navi_navifirst |
|
954 | get_navi_link = get_link_rel_next |
|
955 | ||
956 | @classmethod |
|
957 | def get_comic_info(cls, soup, link): |
|
958 | """Get information about a particular comics.""" |
|
959 | title = soup.find('h2', class_='post-title').string |
|
960 | author = soup.find("span", class_="post-author").find("a").string |
|
961 | date_str = soup.find('span', class_='post-date').string |
|
962 | day = string_to_date(date_str, "%B %d, %Y") |
|
963 | imgs = soup.find('div', id='comic').find_all('img') |
|
964 | return { |
|
965 | 'img': [i['src'] for i in imgs], |
|
966 | 'title': title, |
|
967 | 'author': author, |
|
968 | 'month': day.month, |
|
969 | 'year': day.year, |
|
970 | 'day': day.day, |
|
971 | } |
|
972 | ||
973 | ||
@@ 747-768 (lines=22) @@ | ||
744 | } |
|
745 | ||
746 | ||
747 | class AngryAtNothing(GenericDeletedComic, GenericNavigableComic): |
|
748 | """Class to retrieve Angry at Nothing comics.""" |
|
749 | # Also on http://tapastic.com/series/Comics-yeah-definitely-comics- |
|
750 | # Also on http://angryatnothing.tumblr.com |
|
751 | name = 'angry' |
|
752 | long_name = 'Angry At Nothing' |
|
753 | url = 'http://www.angryatnothing.net' |
|
754 | get_first_comic_link = get_div_navfirst_a |
|
755 | get_navi_link = get_a_rel_next |
|
756 | ||
757 | @classmethod |
|
758 | def get_comic_info(cls, soup, link): |
|
759 | """Get information about a particular comics.""" |
|
760 | title = soup.find('h1', class_='comic-title').find('a').string |
|
761 | date_str = soup.find('header', class_='comic-meta entry-meta').find('a').string |
|
762 | day = string_to_date(date_str, "%B %d, %Y") |
|
763 | imgs = soup.find_all('meta', property='og:image') |
|
764 | return { |
|
765 | 'title': title, |
|
766 | 'month': day.month, |
|
767 | 'year': day.year, |
|
768 | 'day': day.day, |
|
769 | 'img': [i['content'] for i in imgs], |
|
770 | } |
|
771 | ||
@@ 1904-1930 (lines=27) @@ | ||
1901 | } |
|
1902 | ||
1903 | ||
1904 | class PicturesInBoxes(GenericNavigableComic): |
|
1905 | """Class to retrieve Pictures In Boxes comics.""" |
|
1906 | # Also on https://picturesinboxescomic.tumblr.com |
|
1907 | name = 'picturesinboxes' |
|
1908 | long_name = 'Pictures in Boxes' |
|
1909 | url = 'http://www.picturesinboxes.com' |
|
1910 | get_navi_link = get_a_navi_navinext |
|
1911 | get_first_comic_link = simulate_first_link |
|
1912 | first_url = 'http://www.picturesinboxes.com/2013/10/26/tetris/' |
|
1913 | ||
1914 | @classmethod |
|
1915 | def get_comic_info(cls, soup, link): |
|
1916 | """Get information about a particular comics.""" |
|
1917 | title = soup.find('h2', class_='post-title').string |
|
1918 | author = soup.find("span", class_="post-author").find("a").string |
|
1919 | date_str = soup.find('span', class_='post-date').string |
|
1920 | day = string_to_date(date_str, '%B %d, %Y') |
|
1921 | imgs = soup.find('div', class_='comicpane').find_all('img') |
|
1922 | assert imgs |
|
1923 | assert all(i['title'] == i['alt'] == title for i in imgs) |
|
1924 | return { |
|
1925 | 'day': day.day, |
|
1926 | 'month': day.month, |
|
1927 | 'year': day.year, |
|
1928 | 'img': [i['src'] for i in imgs], |
|
1929 | 'title': title, |
|
1930 | 'author': author, |
|
1931 | } |
|
1932 | ||
1933 | ||
@@ 1792-1816 (lines=25) @@ | ||
1789 | } |
|
1790 | ||
1791 | ||
1792 | class MouseBearComedy(GenericComicNotWorking): # Website has changed |
|
1793 | """Class to retrieve Mouse Bear Comedy comics.""" |
|
1794 | # Also on http://mousebearcomedy.tumblr.com |
|
1795 | name = 'mousebear' |
|
1796 | long_name = 'Mouse Bear Comedy' |
|
1797 | url = 'http://www.mousebearcomedy.com' |
|
1798 | get_first_comic_link = get_a_navi_navifirst |
|
1799 | get_navi_link = get_a_navi_comicnavnext_navinext |
|
1800 | ||
1801 | @classmethod |
|
1802 | def get_comic_info(cls, soup, link): |
|
1803 | """Get information about a particular comics.""" |
|
1804 | title = soup.find('h2', class_='post-title').string |
|
1805 | author = soup.find("span", class_="post-author").find("a").string |
|
1806 | date_str = soup.find("span", class_="post-date").string |
|
1807 | day = string_to_date(date_str, '%B %d, %Y') |
|
1808 | imgs = soup.find("div", id="comic").find_all("img") |
|
1809 | assert all(i['alt'] == i['title'] == title for i in imgs) |
|
1810 | return { |
|
1811 | 'day': day.day, |
|
1812 | 'month': day.month, |
|
1813 | 'year': day.year, |
|
1814 | 'img': [i['src'] for i in imgs], |
|
1815 | 'title': title, |
|
1816 | 'author': author, |
|
1817 | } |
|
1818 | ||
1819 | ||
@@ 2883-2907 (lines=25) @@ | ||
2880 | first_url = 'http://www.commitstrip.com/en/2012/02/22/interview/' |
|
2881 | ||
2882 | ||
2883 | class GenericBoumerie(GenericNavigableComic): |
|
2884 | """Generic class to retrieve Boumeries comics in different languages.""" |
|
2885 | # Also on http://boumeries.tumblr.com |
|
2886 | get_first_comic_link = get_a_navi_navifirst |
|
2887 | get_navi_link = get_link_rel_next |
|
2888 | date_format = NotImplemented |
|
2889 | lang = NotImplemented |
|
2890 | ||
2891 | @classmethod |
|
2892 | def get_comic_info(cls, soup, link): |
|
2893 | """Get information about a particular comics.""" |
|
2894 | title = soup.find('h2', class_='post-title').string |
|
2895 | short_url = soup.find('link', rel='shortlink')['href'] |
|
2896 | author = soup.find("span", class_="post-author").find("a").string |
|
2897 | date_str = soup.find('span', class_='post-date').string |
|
2898 | day = string_to_date(date_str, cls.date_format, cls.lang) |
|
2899 | imgs = soup.find('div', id='comic').find_all('img') |
|
2900 | assert all(i['alt'] == i['title'] for i in imgs) |
|
2901 | return { |
|
2902 | 'short_url': short_url, |
|
2903 | 'img': [i['src'] for i in imgs], |
|
2904 | 'title': title, |
|
2905 | 'author': author, |
|
2906 | 'month': day.month, |
|
2907 | 'year': day.year, |
|
2908 | 'day': day.day, |
|
2909 | } |
|
2910 | ||
@@ 2629-2654 (lines=26) @@ | ||
2626 | } |
|
2627 | ||
2628 | ||
2629 | class TheAwkwardYeti(GenericNavigableComic): |
|
2630 | """Class to retrieve The Awkward Yeti comics.""" |
|
2631 | # Also on http://www.gocomics.com/the-awkward-yeti |
|
2632 | # Also on http://larstheyeti.tumblr.com |
|
2633 | # Also on https://tapastic.com/series/TheAwkwardYeti |
|
2634 | name = 'yeti' |
|
2635 | long_name = 'The Awkward Yeti' |
|
2636 | url = 'http://theawkwardyeti.com' |
|
2637 | _categories = ('YETI', ) |
|
2638 | get_first_comic_link = get_a_navi_navifirst |
|
2639 | get_navi_link = get_link_rel_next |
|
2640 | ||
2641 | @classmethod |
|
2642 | def get_comic_info(cls, soup, link): |
|
2643 | """Get information about a particular comics.""" |
|
2644 | title = soup.find('h2', class_='post-title').string |
|
2645 | date_str = soup.find("span", class_="post-date").string |
|
2646 | day = string_to_date(date_str, "%B %d, %Y") |
|
2647 | imgs = soup.find("div", id="comic").find_all("img") |
|
2648 | assert all(idx > 0 or i['alt'] == i['title'] for idx, i in enumerate(imgs)) |
|
2649 | return { |
|
2650 | 'img': [i['src'] for i in imgs], |
|
2651 | 'title': title, |
|
2652 | 'day': day.day, |
|
2653 | 'month': day.month, |
|
2654 | 'year': day.year |
|
2655 | } |
|
2656 | ||
2657 | ||
@@ 2542-2567 (lines=26) @@ | ||
2539 | } |
|
2540 | ||
2541 | ||
2542 | class GerbilWithAJetpack(GenericNavigableComic): |
|
2543 | """Class to retrieve GerbilWithAJetpack comics.""" |
|
2544 | name = 'gerbil' |
|
2545 | long_name = 'Gerbil With A Jetpack' |
|
2546 | url = 'http://gerbilwithajetpack.com' |
|
2547 | get_first_comic_link = get_a_navi_navifirst |
|
2548 | get_navi_link = get_a_rel_next |
|
2549 | ||
2550 | @classmethod |
|
2551 | def get_comic_info(cls, soup, link): |
|
2552 | """Get information about a particular comics.""" |
|
2553 | title = soup.find('h2', class_='post-title').string |
|
2554 | author = soup.find("span", class_="post-author").find("a").string |
|
2555 | date_str = soup.find("span", class_="post-date").string |
|
2556 | day = string_to_date(date_str, "%B %d, %Y") |
|
2557 | imgs = soup.find("div", id="comic").find_all("img") |
|
2558 | alt = imgs[0]['alt'] |
|
2559 | assert all(i['alt'] == i['title'] == alt for i in imgs) |
|
2560 | return { |
|
2561 | 'img': [i['src'] for i in imgs], |
|
2562 | 'title': title, |
|
2563 | 'alt': alt, |
|
2564 | 'author': author, |
|
2565 | 'day': day.day, |
|
2566 | 'month': day.month, |
|
2567 | 'year': day.year |
|
2568 | } |
|
2569 | ||
2570 | ||
@@ 2571-2595 (lines=25) @@ | ||
2568 | } |
|
2569 | ||
2570 | ||
2571 | class EveryDayBlues(GenericDeletedComic, GenericNavigableComic): |
|
2572 | """Class to retrieve EveryDayBlues Comics.""" |
|
2573 | name = "blues" |
|
2574 | long_name = "Every Day Blues" |
|
2575 | url = "http://everydayblues.net" |
|
2576 | get_first_comic_link = get_a_navi_navifirst |
|
2577 | get_navi_link = get_link_rel_next |
|
2578 | ||
2579 | @classmethod |
|
2580 | def get_comic_info(cls, soup, link): |
|
2581 | """Get information about a particular comics.""" |
|
2582 | title = soup.find("h2", class_="post-title").string |
|
2583 | author = soup.find("span", class_="post-author").find("a").string |
|
2584 | date_str = soup.find("span", class_="post-date").string |
|
2585 | day = string_to_date(date_str, "%d. %B %Y", "de_DE.utf8") |
|
2586 | imgs = soup.find("div", id="comic").find_all("img") |
|
2587 | assert all(i['alt'] == i['title'] == title for i in imgs) |
|
2588 | assert len(imgs) <= 1, imgs |
|
2589 | return { |
|
2590 | 'img': [i['src'] for i in imgs], |
|
2591 | 'title': title, |
|
2592 | 'author': author, |
|
2593 | 'day': day.day, |
|
2594 | 'month': day.month, |
|
2595 | 'year': day.year |
|
2596 | } |
|
2597 | ||
2598 |