12-12-2010, 07:22 PM | #1 |
Junior Member
Posts: 6
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. |
12-14-2010, 02:01 PM | #2 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
def get_browser(self): br = BasicNewsRecipe.get_browser(self) br.addheaders = [('Accept', 'text/html')] return br Last edited by Starson17; 12-14-2010 at 02:13 PM. |
|
Advert | |
|
12-14-2010, 03:35 PM | #3 |
Junior Member
Posts: 6
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.
|
12-14-2010, 03:44 PM | #4 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
07-01-2016, 12:20 PM | #5 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jul 2016
Device: kindle fire hdx
|
Not sure if anyone is still tracking this but I updated the feeds and it seems to be working.
Code:
from calibre.web.feeds.news import BasicNewsRecipe import re class Skeptic(BasicNewsRecipe): title = u'The Skeptic' description = 'Discussions with leading experts and investigation of fringe science and paranormal claims.' language = 'en' __author__ = 'Starson17' oldest_article = 31 cover_url = 'http://www.skeptricks.com/images/Skeptic_Magazine.jpg' remove_empty_feeds = True remove_javascript = True max_articles_per_feed = 50 no_stylesheets = True remove_tags = [dict(name='div', attrs={'class':['Introduction','divider']}), dict(name='div', attrs={'id':['feature', 'podcast']}), dict(name='div', attrs={'id':re.compile(r'follow.*', re.DOTALL|re.IGNORECASE)}), dict(name='hr'), ] feeds = [ ('The Skeptic', 'http://feeds.feedburner.com/Skepticcom'), ('E-Skeptic', 'http://www.skeptic.com/eskeptic') ] def get_browser(self): br = BasicNewsRecipe.get_browser(self) br.addheaders = [('Accept', 'text/html')] return br extra_css = ''' h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} p{font-family:Arial,Helvetica,sans-serif;font-size:small;} body{font-family:Helvetica,Arial,sans-serif;font-size:small;} ''' |
Advert | |
|
|
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 |