Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 08-11-2015, 05:10 PM   #1
samrascoe@outloo
Junior Member
samrascoe@outloo began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2015
Device: kindle
Unhappy Broken "The American Spectator" recipe

The following recipe for The American Spectator appears to be broken. I unfortunately lack the knowledge of how to repair it. The recipe worked very well at one time and was created by Darko Miletic. I assume the source has changed.

Any help in restoring the recipe would be greatly appreciated.
Code:
__license__   = 'GPL v3'
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
'''
spectator.org
'''

from calibre.web.feeds.news import BasicNewsRecipe

class TheAmericanSpectator(BasicNewsRecipe):
    title                 = 'The American Spectator'
    __author__            = 'Darko Miletic'
    description           = 'News from USA'
    category              = 'news, politics, USA, world'
    publisher             = 'The American Spectator'
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    language              = 'en'
    INDEX                 = 'http://spectator.org/feed'
    auto_cleanup = True
    encoding = 'utf-8'

    conversion_options = {
                             'comments'        : description
                            ,'tags'            : category
                            ,'language'        : language
                            ,'publisher'       : publisher
                         }

    feeds = [ (u'Articles', u'http://feeds.feedburner.com/amspecarticles')]

    def get_cover_url(self):
        cover_url = None
        soup = self.index_to_soup(self.INDEX)
        link_item = soup.find('a',attrs={'class':'cover'})
        if link_item:
            soup2 = self.index_to_soup(link_item['href'])
            link_item2 = soup2.find('div',attrs={'class':'post inner issues'})
            cover_url = self.INDEX + link_item2.img['src']
        return cover_url

    def print_version(self, url):
        return url + '/print'

    def get_article_url(self, article):
        return article.get('guid', None)

Last edited by PeterT; 08-11-2015 at 05:12 PM. Reason: Wrap recipe in code block to preserve indentation
samrascoe@outloo is offline   Reply With Quote
Old 08-13-2015, 02:03 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...2a676b32ae748f
kovidgoyal is offline   Reply With Quote
Reply

Tags
american spectator, broken recipe, recipe, spectator


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe "DER TAGESSPIEGEL" broken KlausRegenbrecht Recipes 11 03-23-2014 08:42 AM
Recipe for EPUB subscribers of "Tagesspiegel" and "Handelsblatt"? F.W. Recipes 0 05-14-2013 11:16 AM
New recipe for "Süddeutsche Zeitung" using "E-Paper mobile" subscription Ernst Recipes 3 02-16-2013 07:37 AM
Is the American Spectator recipe broken? byzkarl Recipes 1 09-30-2011 11:33 AM
Scientific American recipe broken (?) jamesewood Calibre 4 09-23-2010 03:37 PM


All times are GMT -4. The time now is 06:35 PM.


MobileRead.com is a privately owned, operated and funded community.