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