View Single Post
Old 11-09-2011, 12:32 AM   #8
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
Had some success but

Spoiler:

from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe1289709253(BasicNewsRecipe):
title = u'The Independent My Test'
oldest_article = 7
max_articles_per_feed = 200
summary_length = 100
use_embedded_content = False
no_stylesheets = True
auto_cleanup = True
encoding = 'utf8'

remove_javascript = True

extra_css = '''
h1{font-family:Arial,sans-serif; font-weight:bold;font-size:large;}
h2{font-family:Arial,sans-serif; font-weight:normal;font-size:small;}
body{font-family:Arial,sans-serif;font-size:small;}
p{font-family:Arial,sans-serif;font-size:small;line-height: 1.2;margin-bottom: 0;margin-left: 2pt;
margin-right: 2pt;margin-top: 0;padding-left: 0;padding-right: 0;text-align: left;text-indent: 1.5em}
'''





feeds = [
(u'News - UK',
u'http://www.independent.co.uk/news/uk/?service=rss'),
(u'News - World',
u'http://www.independent.co.uk/news/world/?service=rss'),
(u'News -People Profiles',
u'http://www.independent.co.uk/news/people/profiles/?service=rss'),
(u'News - People',
u'http://www.independent.co.uk/news/people/?service=rss'),
(u'News - Media',
u'http://www.independent.co.uk/news/media/?service=rss'),
(u'Opinion',
u'http://www.independent.co.uk/opinion/?service=rss'),
(u'Sport - Football',
u'http://www.independent.co.uk/sport/football/?service=rss'),
(u'Sport - Fooball Comments',
u'http://www.independent.co.uk/sport/football/news-and-comment/?service=rss'),
(u'Life & Style - Health and Families',
u'http://www.independent.co.uk/life-style/health-and-families/?service=rss'
),
(u'Life & Style - Gadgets & Tech',
u'http://www.independent.co.uk/life-style/gadgets-and-tech/?service=rss'
),
(u'Arts & Ents - Music',
u'http://www.independent.co.uk/arts-entertainment/music/?service=rss'
),
(u'Arts & Ents - Comedy',
u'http://www.independent.co.uk/arts-entertainment/comedy/?service=rss'
)]



def print_version(self, url):
return url.replace('html', 'html?printService=print')


Thiis works on the articles I get. Problem is I am not getting many articles.
For example before trying to get the print version I was getting 100 articles for UK News. With recipe change I get 5. Some categories have none.
Before anyone states the obvious. Yes "oldest article 7" days is a bit much

Last edited by mufc; 11-09-2011 at 12:35 AM.
mufc is offline   Reply With Quote