Quantcast
Channel: MobileRead Forums - Reading and Management
Viewing all articles
Browse latest Browse all 23780

Washington Examiner byline - photos

$
0
0
Is it possible to include byline author + date and photos in this recipe? Created using other scripts, not in standard recipe list. Works well for article heading and body as-is. Thanks.

------------------------------------------------------------------------
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>

from __future__ import (unicode_literals, division, absolute_import,
print_function)
from calibre.web.feeds.news import BasicNewsRecipe


def classes(classes):
q = frozenset(classes.split(' '))
return dict(attrs={
'class': lambda x: x and frozenset(x.split()).intersection(q)})


class WashingtonExaminer(BasicNewsRecipe):
title = u'Washintgon Examiner'
oldest_article = 2
language = 'en'
remove_empty_feeds = True
extra_css = """
body{font-family: Arial,sans-serif }
.caption{font-size: x-small}
.author,.datePub{font-size: small}
"""

__author__ = 'Kovid Goyal'
simultaneous_downloads = 4
max_articles_per_feed = 20
use_embedded_content = False
compress_news_images = True
compress_news_images_auto_size = 8
no_stylesheets = True
use_embedded_content = False
auto_cleanup = True
ignore_duplicate_articles = {'title', 'url'}

feeds = [
('News', 'http://www.washingtonexaminer.com/rss/news'),
('Politics', 'http://www.washingtonexaminer.com/rss/politics'),
('Editorial', 'http://www.washingtonexaminer.com/rss/editorials'),
('Policy', 'http://http://washingtonexaminer.com/rss/policy'),
('Opinion', 'http://www.washingtonexaminer.com/rss/opinion'),
('Columnists', 'http://www.washingtonexaminer.com/rss/columnists'),
('Magazine', 'http://www.washingtonexaminer.com/rss/magazine'),
]

#copied in, not working to present images
def preprocess_html(self, soup):
for img in soup.findAll(attrs={'data-src':True}):
img['src'] = img['data-src']
all_h1s = soup.findAll('h1')
for h1 in all_h1s[1:]:
h1.extract()
return soup

Viewing all articles
Browse latest Browse all 23780

Trending Articles