03-05-2010, 10:55 AM | #1 |
Wizard
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. |
03-05-2010, 11:13 AM | #2 |
creator of calibre
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
|
Advert | |
|
03-05-2010, 11:36 AM | #3 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
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? |
|
03-05-2010, 12:24 PM | #4 |
creator of calibre
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) |
03-05-2010, 03:26 PM | #5 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
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 = '' |
|
Advert | |
|
03-05-2010, 03:28 PM | #6 |
creator of calibre
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. |
03-05-2010, 03:39 PM | #7 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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.
|
|
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 |