View Single Post
Old 09-07-2010, 12:31 PM   #2672
poloman
Enthusiast
poloman began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Nov 2008
Device: PRS505, Kindle 3G
fair point well made - will pm you Tony. doh - thought I'd be able to delete this post - sorry for this - if someone could delete it please!

edit: bringing it back on topic - I (lazily) added a simple feed for slashdot (http://rss.slashdot.org/Slashdot/slashdot) as I didn't want all the comments - the prospect of getting banned using the built in recipe deterred me from using it, and it takes a long time to run.

However, the simple feed results, when it appears on the kindle, shows the article summary fine in the sections view (ie the article title and the beginnings of the article), but when i click to read it, the article and header are not there - just the comments.

Is there a simple solution, or a recipe that solves this? I tried making one that keeps only the artle section, but didnt have much luck: <annoyingly, i seem to have deleted it - but have this one which shows the general idea>

Spoiler:


from calibre.web.feeds.news import BasicNewsRecipe

class SlashDotRecipe(BasicNewsRecipe):
title = 'SlashDot' #v1
language = 'en'
__author__ = 'db'
description = 'SlashDot Articles'
publisher = 'Web'
category = ''
oldest_article = 7
conversion_options = {'linearize_tables' : True}
max_articles_per_feed = 100
no_stylesheets = True

#masthead_url = 'http://www.gtdtimes.com/images/GTDTimes_header.png'

feeds = [
('SlashDot', 'http://rss.slashdot.org/Slashdot/slashdot'),
]

no_stylesheets = True
keep_only_tags = [
dict(name='div',attrs={'class':'body'})
]



remove_tags = [
dict(name='div', attrs={'class':'article-foot'})
]

def get_article_url(self, article):
return article.get('feedburner_origlink', None)


Last edited by poloman; 09-09-2010 at 03:41 AM.
poloman is offline