Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-05-2010, 10:55 AM   #1
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Recipes: Possible to show a feed description?

I'm working on a recipe that will potentially have 150 "feeds," with a subset to be selected by the user. I've put "feeds' into quotes because they are not true RSS feeds. I know the feed URL, and I can calculate the article URL from the feed URL without needing to fetch anything. As a result, I'm using the parse_index method, which returns a feed title and a corresponding list of articles for each feed. I simply generate everything manually and return the generated results.
Each article for each feed gets a title, URL, date and description.

My question: Is it possible to supply (and display) descriptions for the feeds, not just the articles within each feed?

Thanks for any comments.
Starson17 is offline   Reply With Quote
Old 03-05-2010, 11:13 AM   #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,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not when you use parse_index, making a patch to do that should be easy though
kovidgoyal is offline   Reply With Quote
Advert
Old 03-05-2010, 11:36 AM   #3
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kovidgoyal View Post
Not when you use parse_index, making a patch to do that should be easy though
Before patching, is there another method I might try instead of parse_index?

Related question: Looking at other recipes, it appears that feed descriptions appear on the top of the same page that the article links and article descriptions are on. I would have thought that a feed description would logically go on the previous page, i.e., on the page of links for the feeds, not on the page you see after you've selected a feed. Do any methods allow a feed description to appear with its link, so the user can read the description before selecting the feed?
Starson17 is offline   Reply With Quote
Old 03-05-2010, 12:24 PM   #4
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,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No parse_index is it. You'll have to basically have parse_index optionally return a list of 3-tuple instead of 2-tuples where the third element is the description and change the code in feeds.__init__ to optionally handle 3-tuples

Should also be a relatively easy change to add descriptions to the page listing feeds as well as the feed page itself (the reason it's done the way it is is that mostly I envisage people using the metadata tanle of contents, where you can't really have a description)
kovidgoyal is offline   Reply With Quote
Old 03-05-2010, 03:26 PM   #5
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kovidgoyal View Post
No parse_index is it. You'll have to basically have parse_index optionally return a list of 3-tuple instead of 2-tuples where the third element is the description and change the code in feeds.__init__ to optionally handle 3-tuples

Should also be a relatively easy change to add descriptions to the page listing feeds as well as the feed page itself (the reason it's done the way it is is that mostly I envisage people using the metadata tanle of contents, where you can't really have a description)
Thanks for the comments. I've looked over feeds.__init__ and parse_index. As you say, it doesn't look too hard to patch to allow an optional 3 tuple to bring in a feed description with parse_index. OTOH, I was just writing this recipe for others to use, so I'd have to patch, then get it accepted, then have a user upgrade before they could use the recipe. Plus, the docs would need updating for anyone else to use the 3 tuple format in a recipe.

I've already got a working version using the 2-tuple format, with the feed descriptions just added as comments in the recipe. It's usable now.

Do you think writing a patch would be worthwhile? If so, I'll add a bug track and put it on my todo. Up to this point, each patch I've written has been something that I needed personally, so it didn't matter if it was added to the main branch.

BTW, while looking over the code, I spotted what looks like a typo in line 125 of src\calibre\web\feeds\__init__.py/125 in
populate_from_preparsed_feed
Code:
self.descrition = ''
Looks like a missing "p" I'd post a bug, but I didn't have time to track down the effect, so maybe it's not one.
Starson17 is offline   Reply With Quote
Advert
Old 03-05-2010, 03:28 PM   #6
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,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I don't really care about this, so unless you do, don't bother.

descrition is a bug. Doesn't have any effect though.
kovidgoyal is offline   Reply With Quote
Old 03-05-2010, 03:39 PM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kovidgoyal View Post
I don't really care about this, so unless you do, don't bother.
Thanks. I may do it at some point when I have more time, but it's not very high priority. At best, it would make some recipes a bit nicer to have a description of the feeds, but it's nothing earth-shattering.
Starson17 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show & Tell (Show us your handiwork and tell us about it) Lady Blue Lounge 214 08-14-2010 05:36 AM
description for the lrf structure joblack LRF 2 08-01-2009 03:35 PM
Description Fields derrell Fictionwise eBookwise 2 10-28-2008 09:58 AM


All times are GMT -4. The time now is 01:20 PM.


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