@@ 2245-2269 (lines=25) @@ | ||
2242 | } |
|
2243 | ||
2244 | ||
2245 | class LonnieMillsap(GenericNavigableComic): |
|
2246 | """Class to retrieve Lonnie Millsap's comics.""" |
|
2247 | name = 'millsap' |
|
2248 | long_name = 'Lonnie Millsap' |
|
2249 | url = 'http://www.lonniemillsap.com' |
|
2250 | get_navi_link = get_link_rel_next |
|
2251 | get_first_comic_link = simulate_first_link |
|
2252 | first_url = 'http://www.lonniemillsap.com/?p=42' |
|
2253 | ||
2254 | @classmethod |
|
2255 | def get_comic_info(cls, soup, link): |
|
2256 | """Get information about a particular comics.""" |
|
2257 | title = soup.find('h2', class_='post-title').string |
|
2258 | post = soup.find('div', class_='post-content') |
|
2259 | author = post.find("span", class_="post-author").find("a").string |
|
2260 | date_str = post.find("span", class_="post-date").string |
|
2261 | day = string_to_date(date_str, "%B %d, %Y") |
|
2262 | imgs = post.find("div", class_="entry").find_all("img") |
|
2263 | return { |
|
2264 | 'title': title, |
|
2265 | 'author': author, |
|
2266 | 'img': [i['src'] for i in imgs], |
|
2267 | 'month': day.month, |
|
2268 | 'year': day.year, |
|
2269 | 'day': day.day, |
|
2270 | } |
|
2271 | ||
2272 | ||
@@ 896-918 (lines=23) @@ | ||
893 | } |
|
894 | ||
895 | ||
896 | class TheGentlemanArmchair(GenericNavigableComic): |
|
897 | """Class to retrieve The Gentleman Armchair comics.""" |
|
898 | name = 'gentlemanarmchair' |
|
899 | long_name = 'The Gentleman Armchair' |
|
900 | url = 'http://thegentlemansarmchair.com' |
|
901 | get_first_comic_link = get_a_navi_navifirst |
|
902 | get_navi_link = get_link_rel_next |
|
903 | ||
904 | @classmethod |
|
905 | def get_comic_info(cls, soup, link): |
|
906 | """Get information about a particular comics.""" |
|
907 | title = soup.find('h2', class_='post-title').string |
|
908 | author = soup.find("span", class_="post-author").find("a").string |
|
909 | date_str = soup.find('span', class_='post-date').string |
|
910 | day = string_to_date(date_str, "%B %d, %Y") |
|
911 | imgs = soup.find('div', id='comic').find_all('img') |
|
912 | return { |
|
913 | 'img': [i['src'] for i in imgs], |
|
914 | 'title': title, |
|
915 | 'author': author, |
|
916 | 'month': day.month, |
|
917 | 'year': day.year, |
|
918 | 'day': day.day, |
|
919 | } |
|
920 | ||
921 |