diff --git a/src/calibre/gui2/images/news/ars_technica.png b/src/calibre/gui2/images/news/ars_technica.png new file mode 100644 index 0000000000..da88e464dc Binary files /dev/null and b/src/calibre/gui2/images/news/ars_technica.png differ diff --git a/src/calibre/utils/sftp.py b/src/calibre/utils/sftp.py index 49613991b3..84f38f3f4b 100644 --- a/src/calibre/utils/sftp.py +++ b/src/calibre/utils/sftp.py @@ -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())) if not agent_auth(t, username): 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) return sftp, sftp.open(path, mode=mode, bufsize=bufsize) @@ -82,4 +82,4 @@ def main(args=sys.argv): return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index ccb73215ee..6939c0a8ce 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -8,6 +8,7 @@ recipes = [ 'newsweek', 'atlantic', 'economist', 'portfolio', 'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj', 'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', + 'ars_technica', ] import re, imp, inspect, time diff --git a/src/calibre/web/feeds/recipes/ars_technica.py b/src/calibre/web/feeds/recipes/ars_technica.py new file mode 100644 index 0000000000..b7c25e497a --- /dev/null +++ b/src/calibre/web/feeds/recipes/ars_technica.py @@ -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')]