mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 16:05:20 +02:00
...
This commit is contained in:
parent
86aebe0f15
commit
38380ac592
1 changed files with 5 additions and 6 deletions
|
|
@ -4,9 +4,8 @@
|
|||
arstechnica.com
|
||||
'''
|
||||
|
||||
import re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
|
||||
class ArsTechnica(BasicNewsRecipe):
|
||||
title = u'Ars Technica'
|
||||
|
|
@ -21,7 +20,7 @@ class ArsTechnica(BasicNewsRecipe):
|
|||
encoding = 'utf-8'
|
||||
use_embedded_content = False
|
||||
remove_empty_feeds = True
|
||||
publication_type = 'newsportal'
|
||||
publication_type = 'newsportal'
|
||||
extra_css = '''
|
||||
body {font-family: Arial,sans-serif}
|
||||
.heading{font-family: "Times New Roman",serif}
|
||||
|
|
@ -49,7 +48,7 @@ class ArsTechnica(BasicNewsRecipe):
|
|||
]
|
||||
remove_attributes = ['lang']
|
||||
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Infinite Loop (Apple content)' , u'http://feeds.arstechnica.com/arstechnica/apple/' )
|
||||
,(u'Opposable Thumbs (Gaming content)' , u'http://feeds.arstechnica.com/arstechnica/gaming/' )
|
||||
|
|
@ -93,9 +92,9 @@ def preprocess_html(self, soup):
|
|||
item.replaceWith(str)
|
||||
for item in soup.findAll('img'):
|
||||
if not item.has_key('alt'):
|
||||
item['alt'] = 'image'
|
||||
item['alt'] = 'image'
|
||||
return soup
|
||||
|
||||
def preprocess_raw_html(self, raw, url):
|
||||
return '<html><head>'+raw[raw.find('</head>'):]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue