Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-12-2010, 07:22 PM   #1
BuzzKill
Junior Member
BuzzKill began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2010
Device: Kindle
skepticblog.org - Recipe not working

http://skepticblog.org

Ok, I tried to get this one to work, but it doesn't seem to work. Somewhere in the details during processing a HTTP 403 error seems to pop up, but I will appreciate if someone can check it.

Code:
#!/usr/bin/env  python

import re
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag

class SkepticBlog(BasicNewsRecipe):
    title                 = 'Skepticblog'
    __author__            = 'Multiple Authors'
    description           = 'A collaboration among some of the most recognized names in promoting science, critical thinking, and skepticism'
    oldest_article        = 5
    max_articles_per_feed = 15
    no_stylesheets        = True
    use_embedded_content  = False
    encoding              = 'utf-8'
    publisher             = 'Skeptic Magazine'
    category              = 'science, pseudoscience'
    language              = 'en'

    lang                  = 'en-US'

    conversion_options = {
                          'comment'          : description
                        , 'tags'             : category
                        , 'publisher'        : publisher
                        , 'language'         : lang
                        , 'pretty_print'     : True
                        }

    keep_only_tags = [dict(name='div', attrs={'class':'post'})]
    remove_tags_after  = [dict(name='div', attrs={'class':'ratingblock'})]

    feeds = [(u'SkepticBlog', u'http://skepticblog.org/feed')]

    def preprocess_html(self, soup):
        mtag = Tag(soup,'meta',[('http-equiv','Content-Type'),('context','text/html; charset=utf-8')])
        soup.head.insert(0,mtag)
        soup.html['lang'] = self.lang
        return self.adeify_images(soup)

Last edited by BuzzKill; 12-14-2010 at 09:35 AM.
BuzzKill is offline   Reply With Quote
Old 12-14-2010, 02:01 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by BuzzKill View Post
http://skepticblog.org

Ok, I tried to get this one to work, but it doesn't seem to work. Somewhere in the details during processing a HTTP 403 error seems to pop up, but I will appreciate if someone can check it.
That site is running the Bad Behavior module to prevent spam from being posted to the blog. It triggers when Calibre tries to read it. The header code I wrote for The Skeptic recipe will fix it:

Code:
    def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        br.addheaders = [('Accept', 'text/html')]
        return br
BTW, why aren't you using that recipe? It's built in and includes the http://skepticblog.org/feed feed.

Last edited by Starson17; 12-14-2010 at 02:13 PM.
Starson17 is offline   Reply With Quote
 
Enthusiast
Old 12-14-2010, 03:35 PM   #3
BuzzKill
Junior Member
BuzzKill began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2010
Device: Kindle
Oh, I apologize, It didn't occur to me that there would be one already built in. Thank you.
BuzzKill is offline   Reply With Quote
Old 12-14-2010, 03:44 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by BuzzKill View Post
Oh, I apologize, It didn't occur to me that there would be one already built in. Thank you.
That's OK. I had to check myself to make sure it was included. It's hard to remember which feeds are in which recipes.
Starson17 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Guardian Recipe has stopped working jbambridge Calibre 2 04-11-2010 01:14 PM
The Economist (free) recipe not working paladin10000 Calibre 1 01-28-2010 12:44 PM
New Yorker recipe not working ... cartesio Calibre 11 08-20-2009 01:24 AM
Recipe not working phkoech Calibre 3 08-13-2009 05:41 PM
Recipe Suggestion: OnSuper8.Org KindleKid Calibre 0 07-28-2009 12:31 PM


All times are GMT -4. The time now is 01:40 PM.


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