![]() |
#1 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jan 2015
Device: Kindle Voyage
|
Recipe for TheAtlantic.com
Here's a recipe for TheAtlantic.com, an excellent publisher & aggregator of news and editorial about politics, culture, entertainment, tech, etc.
Note that there is a lot more content on TheAtlantic.com than is published in The Atlantic Magazine, and the website is updated constantly unlike the monthly magazine. Although some articles from The Atlantic Magazine do appear on TheAtlantic.com, the magazine requires a subscription while the content on TheAtlantic.com is free. Code:
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1421956712(BasicNewsRecipe): title = 'TheAtlantic.com' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True ignore_duplicate_articles = {'title', 'url'} def print_version(self, url): return url.replace('/archive/', '/print/') feeds = [ ('Politics', 'http://feeds.feedburner.com/AtlanticPoliticsChannel'), ('International', 'http://feeds.feedburner.com/AtlanticInternational'), ('National', 'http://feeds.feedburner.com/AtlanticNational'), ('Science and Tech', 'http://feeds.feedburner.com/AtlanticScienceAndTechnology'), ('Business', 'http://feeds.feedburner.com/AtlanticBusinessChannel'), ('Health', 'http://feeds.feedburner.com/AtlanticFood'), ('Education', 'http://feeds.feedburner.com/AtlanticEducationChannel'), ('Entertainment', 'http://feeds.feedburner.com/AtlanticCulture'), ('Sexes', 'http://feeds.feedburner.com/AtlanticSexesChannel'), ('The Atlantic', 'http://feeds.feedburner.com/TheAtlantic'), ('The Atlatic Wire', 'http://feeds.feedburner.com/TheAtlanticWire'), ] Last edited by kovidgoyal; 01-22-2015 at 10:28 PM. |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jan 2015
Device: Kindle Voyage
|
I don't know how to preserve indentation in recipes I post here. If anyone knows the trick please reply and I'll edit the recipe to reflect the correct indentation.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,309
Karma: 78876004
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
The trick is simple....
Just wrap the script in a [code] ... [/code] block. Code:
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1421956712(BasicNewsRecipe): title = 'TheAtlantic.com' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True ignore_duplicate_articles = {'title', 'url'} def print_version(self, url): return url.replace('/archive/', '/print/') feeds = [ ('Politics', 'http://feeds.feedburner.com/AtlanticPoliticsChannel'), ('International', 'http://feeds.feedburner.com/AtlanticInternational'), ('National', 'http://feeds.feedburner.com/AtlanticNational'), ('Science and Tech', 'http://feeds.feedburner.com/AtlanticScienceAndTechnology'), ('Business', 'http://feeds.feedburner.com/AtlanticBusinessChannel'), ('Health', 'http://feeds.feedburner.com/AtlanticFood'), ('Education', 'http://feeds.feedburner.com/AtlanticEducationChannel'), ('Entertainment', 'http://feeds.feedburner.com/AtlanticCulture'), ('Sexes', 'http://feeds.feedburner.com/AtlanticSexesChannel'), ('The Atlantic', 'http://feeds.feedburner.com/TheAtlantic'), ('The Atlatic Wire', 'http://feeds.feedburner.com/TheAtlanticWire'), ] |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jan 2015
Device: Kindle Voyage
|
Thanks for the info, Peter. I'll use it going forward as I work on new recipes.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe works when mocked up as Python file, fails when converted to Recipe | ode | Recipes | 7 | 09-04-2011 04:57 AM |
New Recipe | UtahJames | Recipes | 3 | 04-18-2011 08:02 PM |
Need Help with Recipe | UtahJames | Recipes | 1 | 04-12-2011 09:50 AM |
New Recipe | UtahJames | Recipes | 1 | 04-11-2011 04:15 PM |
Question on TheAtlantic News Recipe | gilamon | Calibre | 6 | 11-05-2008 03:07 PM |