![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2016
Device: x-platform
|
request - First recipe 99.9% complete (I hope)
So I'm new, there's a bit of a learning curve, but I have this so far:
github.com/TheNotary/calibre_recipe_eff Upon debugging, the 'link' value is empty and can't be parsed. It treats the link element as `<link \> https://actual.link.com` which is obviously no good. I'm trying to parse an rss stream... maybe I'm accidentally using an html only parser or something? Help would be sooo appreciated! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to get articles from an rss feed, all you need is
feeds = ['url of feed'] dont implement parse_index |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2016
Device: x-platform
|
It's important the articles appear in different 'sections', how do I override the default of them all showing up in the 'all articles' section?
Also thanks for making this application!!! ![]() |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Override parse_feeds and do whatever you like to postprocess the result of calling the base class parse_feeds()
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2016
Device: x-platform
|
Have you ever considered defining a consumer centered DSL for defining the parsing of feeds in the clearest way possible and then implementing a system of converting a clearly written script into commands run against calibre? I feel like that might be a sharp way forward to allow end users to customize the manor in which their web content is rendered to eink friendly formats.
I'm game for something like this, but it's all walls for me. What does calling parse_feeds on the base class look like in code? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, IMO creating special purpose DSLs is a much harder to learn solution and much less flexible than using a well known and well designed programming language.
All you need to do is Code:
def parse_feeds(self): feeds = BasicNewsRecipe.parse_feeds(self) # do whatever you want with the feeds object, use print statements to see what it looks like return feeds Last edited by kovidgoyal; 01-20-2016 at 01:19 AM. |
![]() |
![]() |
![]() |
#7 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2016
Device: x-platform
|
Quote:
Code:
$ ebook-convert eff.recipe .epub --test -vv --debug-pipeline debug 1% Converting input to HTML... InputFormatPlugin: Recipe Input running Using custom recipe 1% Fetching feeds... Traceback (most recent call last): File "site.py", line 66, in main File "site-packages/calibre/ebooks/conversion/cli.py", line 360, in main File "site-packages/calibre/ebooks/conversion/plumber.py", line 1051, in run File "site-packages/calibre/customize/conversion.py", line 241, in __call__ File "site-packages/calibre/ebooks/conversion/plugins/recipe_input.py", line 117, in convert File "site-packages/calibre/web/feeds/news.py", line 1029, in download File "site-packages/calibre/web/feeds/news.py", line 1199, in build_index File "<string>", line 41, in parse_feeds File "site-packages/calibre/web/feeds/news.py", line 1630, in parse_feeds File "site-packages/calibre/web/feeds/news.py", line 438, in get_feeds NotImplementedError |
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to also have
feeds = [...] in your recipe |
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2016
Device: x-platform
|
Thanks, I appreciate your help and am making headway now.
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe Request | Tadpole Angel | Recipes | 0 | 07-22-2013 05:49 AM |
recipe request | polymath | Recipes | 0 | 05-22-2013 06:09 PM |
Recipe Request | rayh | Recipes | 1 | 04-09-2012 12:18 AM |
recipe request | chell1948 | Recipes | 1 | 06-02-2011 01:23 PM |
Request for recipe | girlperson1 | Calibre | 2 | 11-13-2008 10:03 PM |