mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Remove Dilbert comic strip feed as dilbert.com has blocked access to the images
This commit is contained in:
parent
7f31efd549
commit
88d138d221
@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
Builtin recipes.
|
||||
'''
|
||||
recipes = [
|
||||
'newsweek', 'atlantic', 'economist', 'dilbert', 'portfolio',
|
||||
'newsweek', 'atlantic', 'economist', 'portfolio',
|
||||
'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
|
||||
'wired', 'globe_and_mail',
|
||||
]
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user