Remove Dilbert comic strip feed as dilbert.com has blocked access to the images

This commit is contained in:
Kovid Goyal 2008-05-02 15:03:53 -07:00
parent 7f31efd549
commit 88d138d221
2 changed files with 1 additions and 36 deletions

View File

@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
Builtin recipes. Builtin recipes.
''' '''
recipes = [ recipes = [
'newsweek', 'atlantic', 'economist', 'dilbert', 'portfolio', 'newsweek', 'atlantic', 'economist', 'portfolio',
'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj', 'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
'wired', 'globe_and_mail', 'wired', 'globe_and_mail',
] ]

View File

@ -1,35 +0,0 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Daily Dilbert
'''
import os
from calibre.web.feeds.news import CustomIndexRecipe
from calibre.ptempfile import PersistentTemporaryDirectory
class Dilbert(CustomIndexRecipe):
title = 'Dilbert'
__author__ = 'Kovid Goyal'
description = 'Daily dilbert comic (from the last five days)'
timefmt = ' [%d %b %Y]'
feeds = [('Dilbert', 'http://feeds.feedburner.com/tapestrydilbert')]
def get_article_url(self, item):
return item.get('enclosures')[0].get('url')
def custom_index(self):
tdir = PersistentTemporaryDirectory('feeds2disk_dilbert')
index = os.path.join(tdir, 'index.html')
feed = self.parse_feeds()[0]
res = ''
for item in feed:
res += '<h3>%s</h3><img style="page-break-after:always" src="%s" />\n'%(item.title, item.url)
res = '<html><body><h1>Dilbert</h1>%s</body></html'%res
open(index, 'wb').write(res)
return index