@@ 3056-3076 (lines=21) @@ | ||
3053 | return { |
|
3054 | 'short_url': short_url, |
|
3055 | 'num': num, |
|
3056 | 'img': [i['src'] for i in imgs], |
|
3057 | 'month': day.month, |
|
3058 | 'year': day.year, |
|
3059 | 'day': day.day, |
|
3060 | 'title': title, |
|
3061 | 'tags': tags, |
|
3062 | 'alt': alt, |
|
3063 | 'author': author, |
|
3064 | } |
|
3065 | ||
3066 | ||
3067 | class SystemComic(GenericNavigableComic): |
|
3068 | """Class to retrieve System Comic.""" |
|
3069 | name = 'system' |
|
3070 | long_name = 'System Comic' |
|
3071 | url = 'http://www.systemcomic.com' |
|
3072 | get_navi_link = get_a_rel_next |
|
3073 | ||
3074 | @classmethod |
|
3075 | def get_first_comic_link(cls): |
|
3076 | """Get link to first comics.""" |
|
3077 | return get_soup_at_url(cls.url).find('li', class_='first').find('a') |
|
3078 | ||
3079 | @classmethod |
|
@@ 847-865 (lines=19) @@ | ||
844 | link = last_soup.find('div', class_='nav-comic nav-right' if next_ else 'nav-comic nav-left') |
|
845 | return link.find('a') if link else None |
|
846 | ||
847 | @classmethod |
|
848 | def get_comic_info(cls, soup, link): |
|
849 | """Get information about a particular comics.""" |
|
850 | title = soup.find('meta', property='og:title')['content'] |
|
851 | imgs = soup.find_all('meta', property='og:image') |
|
852 | desc = soup.find('meta', property='og:description')['content'] |
|
853 | date_str = soup.find('meta', property='article:publish_date')['content'] |
|
854 | day = string_to_date(date_str, "%B %d, %Y") |
|
855 | author = soup.find('meta', property='article:author')['content'] |
|
856 | tags = soup.find('meta', property='article:tag')['content'] |
|
857 | return { |
|
858 | 'title': title, |
|
859 | 'description': desc, |
|
860 | 'img': [i['content'] for i in imgs], |
|
861 | 'author': author, |
|
862 | 'tags': tags, |
|
863 | 'day': day.day, |
|
864 | 'month': day.month, |
|
865 | 'year': day.year |
|
866 | } |
|
867 | ||
868 |