diff --git a/src/libprs500/ebooks/lrf/web/convert_from.py b/src/libprs500/ebooks/lrf/web/convert_from.py
index a67e926a27..c94ed937f0 100644
--- a/src/libprs500/ebooks/lrf/web/convert_from.py
+++ b/src/libprs500/ebooks/lrf/web/convert_from.py
@@ -29,8 +29,11 @@ from libprs500.ebooks.lrf.web.profiles.bbc import BBC
from libprs500.ebooks.lrf.web.profiles.newsweek import Newsweek
from libprs500.ebooks.lrf.web.profiles.economist import Economist
from libprs500.ebooks.lrf.web.profiles.newyorkreview import NewYorkReviewOfBooks
+from libprs500.ebooks.lrf.web.profiles.spiegelde import SpiegelOnline
+from libprs500.ebooks.lrf.web.profiles.zeitde import ZeitNachrichten
-builtin_profiles = [NYTimes, BBC, Newsweek, Economist, NewYorkReviewOfBooks]
+builtin_profiles = [NYTimes, BBC, Newsweek, Economist, NewYorkReviewOfBooks, \
+ SpiegelOnline, ZeitNachrichten]
available_profiles = [i.__module__.rpartition('.')[2] for i in builtin_profiles]
def option_parser():
diff --git a/src/libprs500/ebooks/lrf/web/profiles/spiegelde.py b/src/libprs500/ebooks/lrf/web/profiles/spiegelde.py
new file mode 100644
index 0000000000..3bcf5eb6d1
--- /dev/null
+++ b/src/libprs500/ebooks/lrf/web/profiles/spiegelde.py
@@ -0,0 +1,50 @@
+## Copyright (C) 2007 Kovid Goyal kovid@kovidgoyal.net
+## Costomized to spiegel.de by S. Dorscht stdoonline@googlemail.com
+## Version 0.10
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with this program; if not, write to the Free Software Foundation, Inc.,
+## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+'''
+Fetch Spiegel Online.
+'''
+
+from libprs500.ebooks.lrf.web.profiles import DefaultProfile
+
+import re
+
+class SpiegelOnline(DefaultProfile):
+
+ title = 'Spiegel Online'
+ timefmt = ' [ %Y-%m-%d %a]'
+ max_recursions = 2
+ max_articles_per_feed = 40
+ use_pubdate = False
+ no_stylesheets = True
+
+ preprocess_regexps = \
+ [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
+ [
+ # Remove Zum Thema footer
+ (r'
Please enter your username and password for nytimes.com
If you do not have an account, you can
register for free.
Without a registration, some articles will not be downloaded correctly. Click OK to proceed.')
- d.exec_()
- if d.result() == QDialog.Accepted:
- un, pw = d.username(), d.password()
- self.fetch_news('nytimes', 'New York Times', username=un, password=pw)
-
############################################################################
############################### Convert ####################################
diff --git a/src/libprs500/gui2/news.py b/src/libprs500/gui2/news.py
new file mode 100644
index 0000000000..04b43923b4
--- /dev/null
+++ b/src/libprs500/gui2/news.py
@@ -0,0 +1,65 @@
+## Copyright (C) 2007 Kovid Goyal kovid@kovidgoyal.net
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with this program; if not, write to the Free Software Foundation, Inc.,
+## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from PyQt4.QtCore import QObject, SIGNAL
+from PyQt4.QtGui import QMenu, QIcon, QDialog
+
+from libprs500.gui2.dialogs.password import PasswordDialog
+
+class NewsMenu(QMenu):
+
+ def add_menu_item(self, title, func, icon=':/images/news.svg'):
+ self.addAction(QIcon(icon), title)
+ QObject.connect(self.actions()[-1], SIGNAL('triggered(bool)'), func)
+
+ def __init__(self):
+ QMenu.__init__(self)
+ self.add_menu_item('BBC', self.fetch_news_bbc, ':/images/news/bbc.png')
+ self.add_menu_item('Economist', self.fetch_news_economist, ':/images/news/economist.png')
+ self.add_menu_item('Newsweek', self.fetch_news_newsweek, ':/images/news/newsweek.png')
+ self.add_menu_item('New York Review of Books', self.fetch_news_nyreview, ':/images/book.svg')
+ self.add_menu_item('New York Times', self.fetch_news_nytimes, ':/images/news/nytimes.png')
+ self.add_menu_item('Spiegel Online', self.fetch_news_spiegelde)
+ self.add_menu_item('Zeit Nachrichten', self.fetch_news_zeitde)
+
+ def fetch_news(self, profile, title, username=None, password=None):
+ data = dict(profile=profile, title=title, username=username, password=password)
+ self.emit(SIGNAL('fetch_news(PyQt_PyObject)'), data)
+
+ def fetch_news_spiegelde(self, checked):
+ self.fetch_news('speigelde', 'Spiegel Online')
+
+ def fetch_news_zeitde(self, checked):
+ self.fetch_news('zeitde', 'Zeit Nachrichten')
+
+ def fetch_news_bbc(self, checked):
+ self.fetch_news('bbc', 'BBC')
+
+ def fetch_news_newsweek(self, checked):
+ self.fetch_news('newsweek', 'Newsweek')
+
+ def fetch_news_economist(self, checked):
+ self.fetch_news('economist', 'The Economist')
+
+ def fetch_news_nyreview(self, checked):
+ self.fetch_news('newyorkreview', 'New York Review of Books')
+
+ def fetch_news_nytimes(self, checked):
+ d = PasswordDialog(self, 'nytimes info dialog',
+ '
Please enter your username and password for nytimes.com
If you do not have an account, you can register for free.
Without a registration, some articles will not be downloaded correctly. Click OK to proceed.')
+ d.exec_()
+ if d.result() == QDialog.Accepted:
+ un, pw = d.username(), d.password()
+ self.fetch_news('nytimes', 'New York Times', username=un, password=pw)
\ No newline at end of file