|
@@ 2220-2244 (lines=25) @@
|
| 2217 |
|
} |
| 2218 |
|
|
| 2219 |
|
|
| 2220 |
|
class LonnieMillsap(GenericNavigableComic): |
| 2221 |
|
"""Class to retrieve Lonnie Millsap's comics.""" |
| 2222 |
|
name = 'millsap' |
| 2223 |
|
long_name = 'Lonnie Millsap' |
| 2224 |
|
url = 'http://www.lonniemillsap.com' |
| 2225 |
|
get_navi_link = get_link_rel_next |
| 2226 |
|
get_first_comic_link = simulate_first_link |
| 2227 |
|
first_url = 'http://www.lonniemillsap.com/?p=42' |
| 2228 |
|
|
| 2229 |
|
@classmethod |
| 2230 |
|
def get_comic_info(cls, soup, link): |
| 2231 |
|
"""Get information about a particular comics.""" |
| 2232 |
|
title = soup.find('h2', class_='post-title').string |
| 2233 |
|
post = soup.find('div', class_='post-content') |
| 2234 |
|
author = post.find("span", class_="post-author").find("a").string |
| 2235 |
|
date_str = post.find("span", class_="post-date").string |
| 2236 |
|
day = string_to_date(date_str, "%B %d, %Y") |
| 2237 |
|
imgs = post.find("div", class_="entry").find_all("img") |
| 2238 |
|
return { |
| 2239 |
|
'title': title, |
| 2240 |
|
'author': author, |
| 2241 |
|
'img': [i['src'] for i in imgs], |
| 2242 |
|
'month': day.month, |
| 2243 |
|
'year': day.year, |
| 2244 |
|
'day': day.day, |
| 2245 |
|
} |
| 2246 |
|
|
| 2247 |
|
|
|
@@ 883-905 (lines=23) @@
|
| 880 |
|
} |
| 881 |
|
|
| 882 |
|
|
| 883 |
|
class TheGentlemanArmchair(GenericNavigableComic): |
| 884 |
|
"""Class to retrieve The Gentleman Armchair comics.""" |
| 885 |
|
name = 'gentlemanarmchair' |
| 886 |
|
long_name = 'The Gentleman Armchair' |
| 887 |
|
url = 'http://thegentlemansarmchair.com' |
| 888 |
|
get_first_comic_link = get_a_navi_navifirst |
| 889 |
|
get_navi_link = get_link_rel_next |
| 890 |
|
|
| 891 |
|
@classmethod |
| 892 |
|
def get_comic_info(cls, soup, link): |
| 893 |
|
"""Get information about a particular comics.""" |
| 894 |
|
title = soup.find('h2', class_='post-title').string |
| 895 |
|
author = soup.find("span", class_="post-author").find("a").string |
| 896 |
|
date_str = soup.find('span', class_='post-date').string |
| 897 |
|
day = string_to_date(date_str, "%B %d, %Y") |
| 898 |
|
imgs = soup.find('div', id='comic').find_all('img') |
| 899 |
|
return { |
| 900 |
|
'img': [i['src'] for i in imgs], |
| 901 |
|
'title': title, |
| 902 |
|
'author': author, |
| 903 |
|
'month': day.month, |
| 904 |
|
'year': day.year, |
| 905 |
|
'day': day.day, |
| 906 |
|
} |
| 907 |
|
|
| 908 |
|
|