View Single Post
Old 01-22-2015, 06:39 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,537
Karma: 78910202
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'),
    ]
PeterT is offline   Reply With Quote