Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
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
Old 06-14-2012, 03:23 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,870
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You implement parse_index() in your recipe. There are amny builtin recipes that do this, look at them for examples.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-14-2012, 03:53 PM   #3
_reader
Member
_reader doesn't litter_reader doesn't litter
 
Posts: 24
Karma: 142
Join Date: Sep 2010
Device: K3, KPW
Thanks, Kovid. I'll look at parse_index().
_reader is offline   Reply With Quote
Reply

Tags
article, date, url


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
headline of first article is shown, furthers are not in the article pages DisasterArea Recipes 1 02-02-2012 05:29 PM
Create Article Sections From Feed? Finbar127 Recipes 5 02-26-2011 08:55 AM
Decorate article headings as hyperlinks to full article? tomsem Recipes 5 10-15-2010 08:30 PM
Break up feed BrianG Calibre 2 01-09-2010 06:13 PM
the feed only contains a link ... alexxxm Calibre 7 02-18-2009 08:43 AM


All times are GMT -4. The time now is 12:35 AM.


MobileRead.com is a privately owned, operated and funded community.