Added recipe for Ars Technica (thanks to Michael Warner)

This commit is contained in:
Kovid Goyal 2008-06-01 21:30:09 -07:00
parent 10f204b2f6
commit e2810c4b50
4 changed files with 52 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

View File

@ -68,7 +68,7 @@ def connect_to_url(url, getpw=portable_getpass, mode='r+', bufsize=-1):
raise Exception(_('Failed to negotiate SSH session: ') + str(t.get_exception())) raise Exception(_('Failed to negotiate SSH session: ') + str(t.get_exception()))
if not agent_auth(t, username): if not agent_auth(t, username):
if not password_auth(t, username, host, getpw): if not password_auth(t, username, host, getpw):
raise ValueError(_('Failed to authenticate with server: %s'%url)) raise ValueError(_('Failed to authenticate with server: %s')%url)
sftp = paramiko.SFTPClient.from_transport(t) sftp = paramiko.SFTPClient.from_transport(t)
return sftp, sftp.open(path, mode=mode, bufsize=bufsize) return sftp, sftp.open(path, mode=mode, bufsize=bufsize)

View File

@ -8,6 +8,7 @@ recipes = [
'newsweek', 'atlantic', 'economist', 'portfolio', 'newsweek', 'atlantic', 'economist', 'portfolio',
'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj', 'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', 'wired', 'globe_and_mail', 'smh', 'espn', 'business_week',
'ars_technica',
] ]
import re, imp, inspect, time import re, imp, inspect, time

View File

@ -0,0 +1,49 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
arstechnica.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class ArsTechnica(BasicNewsRecipe):
title = 'Ars Technica'
description = 'The art of technology'
oldest_article = 7
no_stylesheets = True
__author__ = 'Michael Warner'
max_articles_per_feed = 100
extra_css = """
body {
font: normal 19px/180% Times, serif;
}
h1, h2, h3, h4 {
font: bold 28px/100% Verdana, Arial, Helvetica, sans-serif;
margin-top: 19px
}
"""
remove_tags = [
dict(id="Masthead"),
dict(id="Banner"),
dict(id="Nav"),
dict(name='div', attrs={'class':'ContentHeader'}),
dict(name='img'),
dict(name='div', attrs={'class':'Inset RelatedStories'}),
dict(name='div', attrs={'class':'Tags'}),
dict(name='div', attrs={'class':'PostOptions flat'}),
dict(name='div', attrs={'class':'ContentFooter'}),
dict(id="Sidebar"),
dict(id="LatestPosts"),
dict(id="Footer")]
feeds = [(u'News and Features', u'http://feeds.arstechnica.com/arstechnica/BAaf'),
(u'Nobel Intent (Science)', u'http://arstechnica.com/journals/science.rssx'),
(u'Infinite Loop (Apple)', u'http://arstechnica.com/journals/apple.rssx'),
(u'M-Dollar (Microsoft)', u'http://arstechnica.com/journals/microsoft.rssx'),
(u'Open Ended (Linux)', u'http://arstechnica.com/journals/linux.rssx'),
(u'Opposable Thumbs (Games)', u'http://arstechnica.com/journals/thumbs.rssx'),
(u'Kit (Hardware)', u'http://arstechnica.com/journals/hardware.rssx'),
(u'Journals', u'http://arstechnica.com/journals.rssx')]