From c72c2c86490c87ff1a9acd0af91e0dca7ac4eaa7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Mar 2013 21:28:22 +0530 Subject: [PATCH] Eclipse Online by Jim DeVona --- recipes/eclipseonline.recipe | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 recipes/eclipseonline.recipe diff --git a/recipes/eclipseonline.recipe b/recipes/eclipseonline.recipe new file mode 100644 index 0000000000..6d98120470 --- /dev/null +++ b/recipes/eclipseonline.recipe @@ -0,0 +1,38 @@ +from calibre.web.feeds.news import BasicNewsRecipe +class EclipseOnline(BasicNewsRecipe): + + # + # oldest_article specifies the maximum age, in days, of posts to retrieve. + # The default of 32 is intended to work well with a "days of month = 1" + # recipe schedule to download "monthly issues" of Eclipse Online. + # Increase this value to include additional posts. However, the RSS feed + # currently only includes the 10 most recent posts, so that's the max. + # + oldest_article = 32 + + title = u'Eclipse Online' + description = u'"Where strange and wonderful things happen, where reality is eclipsed for a little while with something magical and new." Eclipse Online is edited by Jonathan Strahan and published online by Night Shade Books. http://www.nightshadebooks.com/category/eclipse/' + publication_type = 'magazine' + language = 'en' + + __author__ = u'Jim DeVona' + __version__ = '1.0' + + # For now, use this Eclipse Online logo as the ebook cover image. + # (Disable the cover_url line to let Calibre generate a default cover, including date.) + cover_url = 'http://www.nightshadebooks.com/wp-content/uploads/2012/10/Eclipse-Logo.jpg' + + # Extract the "post" div containing the story (minus redundant metadata) from each page. + keep_only_tags = [dict(name='div', attrs={'class':lambda x: x and 'post' in x})] + remove_tags = [dict(name='span', attrs={'class': ['post-author', 'post-category', 'small']})] + + # Nice plain markup (like Eclipse's) works best for most e-readers. + # Disregard any special styling rules, but center illustrations. + auto_cleanup = False + no_stylesheets = True + remove_attributes = ['style', 'align'] + extra_css = '.wp-caption {text-align: center;} .wp-caption-text {font-size: small; font-style: italic;}' + + # Tell Calibre where to look for article links. It will proceed to retrieve + # these posts and format them into an ebook according to the above rules. + feeds = ['http://www.nightshadebooks.com/category/eclipse/feed/']