mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
#!/usr/bin/env python
|
|
|
|
__license__ = 'GPL v3'
|
|
__copyright__ = 'Zotzo'
|
|
'''
|
|
http://www.stumptownfooty.com/
|
|
http://www.eightysixforever.com
|
|
http://www.sounderatheart.com
|
|
http://www.dailysoccerfix.com/
|
|
|
|
'''
|
|
from calibre.web.feeds.news import BasicNewsRecipe
|
|
|
|
|
|
class SBNation(BasicNewsRecipe):
|
|
title = u'SBNation'
|
|
__author__ = 'rylsfan'
|
|
description = u"More than 290 individual communities, each offering high quality year-round coverage and conversation led by fans who are passionate."
|
|
oldest_article = 3
|
|
language = 'en'
|
|
max_articles_per_feed = 100
|
|
no_stylesheets = True
|
|
use_embedded_content = False
|
|
|
|
keep_only_tags = [
|
|
dict(name='h2', attrs={'class': 'title'}), dict(
|
|
name='div', attrs={'class': 'entry-body'})
|
|
]
|
|
|
|
remove_tags_after = dict(
|
|
name='div', attrs={'class': 'footline entry-actions'})
|
|
remove_tags = [
|
|
dict(name='div', attrs={'class': 'footline entry-actions'}),
|
|
{'class': 'extend-divide'}
|
|
]
|
|
# SBNation has 300 special blogs to choose from. These are just a couple!
|
|
feeds = [
|
|
(u'Daily Fix', u'http://www.dailysoccerfix.com/rss/'),
|
|
(u"Stumptown Footy", u'http://www.stumptownfooty.com/rss/'),
|
|
(u'Sounders', u'http://www.sounderatheart.com/rss/'),
|
|
(u'Whitecaps', u'http://www.eightysixforever.com/rss/'),
|
|
]
|
|
|
|
extra_css = """
|
|
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
|
|
h2{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
|
|
p{font-family:Helvetica,sans-serif; display: block; text-align: left; text-decoration: none; text-indent: 0%;}
|
|
body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
|
|
"""
|
|
|
|
def preprocess_html(self, soup):
|
|
return self.adeify_images(soup)
|
|
|
|
def populate_article_metadata(self, article, soup, first):
|
|
h2 = soup.find('h2')
|
|
h2.replaceWith(h2.prettify() + '<p><em> By ' +
|
|
article.author + '</em></p>')
|