@@ 2497-2521 (lines=25) @@ | ||
2494 | } |
|
2495 | ||
2496 | ||
2497 | class LonnieMillsap(GenericNavigableComic): |
|
2498 | """Class to retrieve Lonnie Millsap's comics.""" |
|
2499 | name = 'millsap' |
|
2500 | long_name = 'Lonnie Millsap' |
|
2501 | url = 'http://www.lonniemillsap.com' |
|
2502 | get_navi_link = get_link_rel_next |
|
2503 | get_first_comic_link = simulate_first_link |
|
2504 | first_url = 'http://www.lonniemillsap.com/?p=42' |
|
2505 | ||
2506 | @classmethod |
|
2507 | def get_comic_info(cls, soup, link): |
|
2508 | """Get information about a particular comics.""" |
|
2509 | title = soup.find('h2', class_='post-title').string |
|
2510 | post = soup.find('div', class_='post-content') |
|
2511 | author = post.find("span", class_="post-author").find("a").string |
|
2512 | date_str = post.find("span", class_="post-date").string |
|
2513 | day = string_to_date(date_str, "%B %d, %Y") |
|
2514 | imgs = post.find("div", class_="entry").find_all("img") |
|
2515 | return { |
|
2516 | 'title': title, |
|
2517 | 'author': author, |
|
2518 | 'img': [i['src'] for i in imgs], |
|
2519 | 'month': day.month, |
|
2520 | 'year': day.year, |
|
2521 | 'day': day.day, |
|
2522 | } |
|
2523 | ||
2524 | ||
@@ 974-996 (lines=23) @@ | ||
971 | } |
|
972 | ||
973 | ||
974 | class TheGentlemanArmchair(GenericNavigableComic): |
|
975 | """Class to retrieve The Gentleman Armchair comics.""" |
|
976 | name = 'gentlemanarmchair' |
|
977 | long_name = 'The Gentleman Armchair' |
|
978 | url = 'http://thegentlemansarmchair.com' |
|
979 | get_first_comic_link = get_a_navi_navifirst |
|
980 | get_navi_link = get_link_rel_next |
|
981 | ||
982 | @classmethod |
|
983 | def get_comic_info(cls, soup, link): |
|
984 | """Get information about a particular comics.""" |
|
985 | title = soup.find('h2', class_='post-title').string |
|
986 | author = soup.find("span", class_="post-author").find("a").string |
|
987 | date_str = soup.find('span', class_='post-date').string |
|
988 | day = string_to_date(date_str, "%B %d, %Y") |
|
989 | imgs = soup.find('div', id='comic').find_all('img') |
|
990 | return { |
|
991 | 'img': [i['src'] for i in imgs], |
|
992 | 'title': title, |
|
993 | 'author': author, |
|
994 | 'month': day.month, |
|
995 | 'year': day.year, |
|
996 | 'day': day.day, |
|
997 | } |
|
998 | ||
999 |