View Single Post
Old 06-14-2012, 02:37 PM   #1
_reader
Member
_reader doesn't litter_reader doesn't litter
 
Posts: 24
Karma: 142
Join Date: Sep 2010
Device: K3, KPW
Question Help: When Article is Feed?

How do we handle recipes where the url points to an article? (instead of a feed containing articles)

Seems like
Code:
use_embedded_content = False
should work.

Attached recipe has fix for today's date in url.
However, running recipe fails in build_index by not finding articles....
Debug output has links to feed urls.

Recipe:
Spoiler:
Code:
import datetime
class Evangelizo_org(BasicNewsRecipe):
	title = u'Evangelizo.org'
	oldest_article = 1
	max_articles_per_feed = 3
	no_stylesheets = True
	use_embedded_content = False
   	encoding = None
	simultaneous_downloads = 20
	recursions = 0
	remove_javascript = True
	remove_empty_feeds = True
	auto_cleanup = False

	td = datetime.date.today()
	r1 = 'http://feed.evangelizo.org/reader.php?date=' \
			+ td.strftime("%Y%m%d") + '&type=reading&lang=AM&content=FR'
	r2 = 'http://feed.evangelizo.org/reader.php?date=' \
			+ td.strftime("%Y%m%d") + '&type=reading&lang=AM&content=PS'
	r3 = 'http://feed.evangelizo.org/reader.php?date=' \
			+ td.strftime("%Y%m%d") + '&type=reading&lang=AM&content=GSP'
	
	print 'At this point in the code the value of r1 is: ', r1
	print 'At this point in the code the value of r2 is: ', r2
	print 'At this point in the code the value of r3 is: ', r3

	feeds = [	
		(u'Reading', r1),
		(u'Psalm', r2),
		(u'Gospel', r3),
		]

Debug output:
Spoiler:

InputFormatPlugin: Recipe Input running
At this point in the code the value of r1 is: http://feed.evangelizo.org/reader.ph...=AM&content=FR
At this point in the code the value of r2 is: http://feed.evangelizo.org/reader.ph...=AM&content=PS
At this point in the code the value of r3 is: http://feed.evangelizo.org/reader.ph...AM&content=GSP
1% Fetching feeds...
1% Fetching feed Reading...
1% Fetching feed Psalm...
Python function terminated unexpectedly
No articles found, aborting (Error Code: 1)

Traceback:
Spoiler:

Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\ebooks\conversion\cli.py", line 325, in main
File "site-packages\calibre\ebooks\conversion\plumber.py", line 979, in run
File "site-packages\calibre\customize\conversion.py", line 208, in __call__
File "site-packages\calibre\ebooks\conversion\plugins\recipe_ input.py", line 105, in convert
File "site-packages\calibre\web\feeds\news.py", line 874, in download
File "site-packages\calibre\web\feeds\news.py", line 1026, in build_index
ValueError: No articles found, aborting


Original thread: https://www.mobileread.com/forums/sho...d.php?t=154396 by entodoays https://www.mobileread.com/forums/member.php?u=139059

Last edited by _reader; 06-14-2012 at 03:50 PM.
_reader is offline   Reply With Quote