Thread: Calibre recipes
View Single Post
Old 04-25-2009, 09:10 PM   #49
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Here's what I get now and here's my recipe modified.

Could not create recipe. Error: invalid syntax (recipe 20 py, line 15). This changes everytime I make a change but the line number stays the same.

`````

#!/usr/bin/env python

__license__ = 'GPL v3'
__copyright__ = '2009, Darko Miletic <xxxxxxxxxxxxxxx>'
'''
sciencedaily.com
'''
from calibre.web.feeds.news import BasicNewsRecipe

class ScienceDailySpec(BasicNewsRecipe):
title = 'ScienceDaily - Alzheimer's'
__author__ = 'Darko Miletic'
description = "Breaking science news and articles on global
warming, extrasolar planets, stem cells, bird flu, autism, nanotechnology,
dinosaurs, evolution -- the latest discoveries in astronomy, anthropology,
biology, chemistry, climate &amp; environment, computers, engineering,
health &amp; medicine, math, physics, psychology, technology, and more --
from the world's leading universities and research organizations."
oldest_article = 10000
language = _('English')
max_articles_per_feed = 1000
no_stylesheets = True
use_embedded_content = False

keep_only_tags = [
dict(name='h1', attrs={'class':'story'})
,dict(name='div', attrs={'id':'story'})
]

remove_tags_after = dict(name='div', attrs={'id':'citationbox'})
remove_tags = [
dict(name='div', attrs={'id':'seealso'})
,dict(name='div', attrs={'id':'citationbox'})
]

feeds = [
(u"Alzheimer's Research News", u"http://www.sciencedaily.com/rss/health_medicine/alzheimer's.xml"),
(u"Alzheimer's Research News", u"http://www.sciencedaily.com/rss/mind_brain/alzheimer's.xml")
]

~~~~~~~~~~
I know nothing about this type of programming so I am accomplishing the separation above using carriage returns - which I'm sure is wrong. Tried using a "tab" but that didn't work either. I'm feeling really dumb right now since I took visual basic programming a while back and should be better at this even tho' it's different. Sorry, and thanks for your help.
pghaworth is offline   Reply With Quote