Recipes are made in
pyton language but you don't need to know much to create one.
First try to check some recipes examples.
To do that open Calibre and press the arrow near
Fetch news -> Add custom news source-> Customize buildin recipe and select
ScienceDaily[en] by Darko Miletic - this is a clean and easy to understand recipe.
Copy
ScienceDaily template in a file, rename it, set extension .recipe then change:
keep_only_tags – represents what html tags will appear in subscription.
keep_only_tags = [ dict(name='h1', attrs={'class':'story'}) - ScienceDaily recipe take content from tag h1 with css class named story
remove_tags_after - where parsing operation have to stop
remove_tags_after = dict(name='div', attrs={'id':'citationbox'}) - parsing operation stop after tag div with id=citationbox
remove_tags – what html tags will be removed from elements parsed using
keep_only_tags
remove_tags = [dict(name='div', attrs={'id':'citationbox'} - will remove tag div with id=citationbox
feeds – your rss list
feeds = [(u"ScienceDaily", u'http://www.sciencedaily.com/newsfeed.xml')]
You have to change
class name, title, description and cover_url.
Copy your recipe in folder where Calibre is installed and run this in command prompt:
C:\Program Files\Calibre2>ebook-convert YourRecipe.recipe D:\temp –test -vv
Check index.html from D:\temp.
To inspect a html file i recommend
firebug plugin and firefox
You can find a recipe tutorial at
calibre-ebook