@@ 389-414 (lines=26) @@ | ||
386 | _categories = ('DELETED', ) |
|
387 | ||
388 | ||
389 | class ExtraFabulousComics(GenericNavigableComic): |
|
390 | """Class to retrieve Extra Fabulous Comics.""" |
|
391 | # Also on https://extrafabulouscomics.tumblr.com |
|
392 | name = 'efc' |
|
393 | long_name = 'Extra Fabulous Comics' |
|
394 | url = 'http://extrafabulouscomics.com' |
|
395 | _categories = ('EFC', ) |
|
396 | get_navi_link = get_link_rel_next |
|
397 | get_first_comic_link = simulate_first_link |
|
398 | first_url = 'http://extrafabulouscomics.com/comic/buttfly/' |
|
399 | ||
400 | @classmethod |
|
401 | def get_comic_info(cls, soup, link): |
|
402 | """Get information about a particular comics.""" |
|
403 | img_src_re = re.compile('^%s/wp-content/uploads/' % cls.url) |
|
404 | imgs = soup.find_all('img', src=img_src_re) |
|
405 | title = soup.find('meta', property='og:title')['content'] |
|
406 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
407 | day = string_to_date(date_str, "%Y-%m-%d") |
|
408 | return { |
|
409 | 'title': title, |
|
410 | 'img': [i['src'] for i in imgs], |
|
411 | 'month': day.month, |
|
412 | 'year': day.year, |
|
413 | 'day': day.day, |
|
414 | 'prefix': title + '-' |
|
415 | } |
|
416 | ||
417 | ||
@@ 2395-2419 (lines=25) @@ | ||
2392 | } |
|
2393 | ||
2394 | ||
2395 | class LinsEditions(GenericNavigableComic): |
|
2396 | """Class to retrieve L.I.N.S. Editions comics.""" |
|
2397 | # Also on https://linscomics.tumblr.com |
|
2398 | # Now on https://warandpeas.com |
|
2399 | name = 'lins' |
|
2400 | long_name = 'L.I.N.S. Editions' |
|
2401 | url = 'https://linsedition.com' |
|
2402 | _categories = ('LINS', ) |
|
2403 | get_navi_link = get_link_rel_next |
|
2404 | get_first_comic_link = simulate_first_link |
|
2405 | first_url = 'https://linsedition.com/2011/09/07/l-i-n-s/' |
|
2406 | ||
2407 | @classmethod |
|
2408 | def get_comic_info(cls, soup, link): |
|
2409 | """Get information about a particular comics.""" |
|
2410 | title = soup.find('meta', property='og:title')['content'] |
|
2411 | imgs = soup.find_all('meta', property='og:image') |
|
2412 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
2413 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2414 | return { |
|
2415 | 'title': title, |
|
2416 | 'img': [i['content'] for i in imgs], |
|
2417 | 'month': day.month, |
|
2418 | 'year': day.year, |
|
2419 | 'day': day.day, |
|
2420 | } |
|
2421 | ||
2422 | ||
@@ 1076-1100 (lines=25) @@ | ||
1073 | } |
|
1074 | ||
1075 | ||
1076 | class Mercworks(GenericNavigableComic): |
|
1077 | """Class to retrieve Mercworks comics.""" |
|
1078 | # Also on http://mercworks.tumblr.com |
|
1079 | name = 'mercworks' |
|
1080 | long_name = 'Mercworks' |
|
1081 | url = 'http://mercworks.net' |
|
1082 | get_first_comic_link = get_a_comicnavbase_comicnavfirst |
|
1083 | get_navi_link = get_link_rel_next |
|
1084 | ||
1085 | @classmethod |
|
1086 | def get_comic_info(cls, soup, link): |
|
1087 | """Get information about a particular comics.""" |
|
1088 | title = soup.find('meta', property='og:title')['content'] |
|
1089 | metadesc = soup.find('meta', property='og:description') |
|
1090 | desc = metadesc['content'] if metadesc else "" |
|
1091 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
1092 | day = string_to_date(date_str, "%Y-%m-%d") |
|
1093 | imgs = soup.find_all('meta', property='og:image') |
|
1094 | return { |
|
1095 | 'img': [i['content'] for i in imgs], |
|
1096 | 'title': title, |
|
1097 | 'desc': desc, |
|
1098 | 'day': day.day, |
|
1099 | 'month': day.month, |
|
1100 | 'year': day.year |
|
1101 | } |
|
1102 | ||
1103 | ||
@@ 3402-3423 (lines=22) @@ | ||
3399 | } |
|
3400 | ||
3401 | ||
3402 | class MarketoonistComics(GenericNavigableComic): |
|
3403 | """Class to retrieve Marketoonist Comics.""" |
|
3404 | name = 'marketoonist' |
|
3405 | long_name = 'Marketoonist' |
|
3406 | url = 'https://marketoonist.com/cartoons' |
|
3407 | get_first_comic_link = simulate_first_link |
|
3408 | get_navi_link = get_link_rel_next |
|
3409 | first_url = 'https://marketoonist.com/2002/10/the-8-types-of-brand-managers-2.html' |
|
3410 | ||
3411 | @classmethod |
|
3412 | def get_comic_info(cls, soup, link): |
|
3413 | """Get information about a particular comics.""" |
|
3414 | imgs = soup.find_all('meta', property='og:image') |
|
3415 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
3416 | day = string_to_date(date_str, "%Y-%m-%d") |
|
3417 | title = soup.find('meta', property='og:title')['content'] |
|
3418 | return { |
|
3419 | 'img': [i['content'] for i in imgs], |
|
3420 | 'day': day.day, |
|
3421 | 'month': day.month, |
|
3422 | 'year': day.year, |
|
3423 | 'title': title, |
|
3424 | } |
|
3425 | ||
3426 | ||
@@ 418-439 (lines=22) @@ | ||
415 | } |
|
416 | ||
417 | ||
418 | class GenericLeMondeBlog(GenericNavigableComic): |
|
419 | """Generic class to retrieve comics from Le Monde blogs.""" |
|
420 | _categories = ('LEMONDE', 'FRANCAIS') |
|
421 | get_navi_link = get_link_rel_next |
|
422 | get_first_comic_link = simulate_first_link |
|
423 | first_url = NotImplemented |
|
424 | ||
425 | @classmethod |
|
426 | def get_comic_info(cls, soup, link): |
|
427 | """Get information about a particular comics.""" |
|
428 | url2 = soup.find('link', rel='shortlink')['href'] |
|
429 | title = soup.find('meta', property='og:title')['content'] |
|
430 | date_str = soup.find("span", class_="entry-date").string |
|
431 | day = string_to_date(date_str, "%d %B %Y", "fr_FR.utf8") |
|
432 | imgs = soup.find_all('meta', property='og:image') |
|
433 | return { |
|
434 | 'title': title, |
|
435 | 'url2': url2, |
|
436 | 'img': [convert_iri_to_plain_ascii_uri(i['content']) for i in imgs], |
|
437 | 'month': day.month, |
|
438 | 'year': day.year, |
|
439 | 'day': day.day, |
|
440 | } |
|
441 | ||
442 |