From 1a45dc51a52d2deaac8b12bc6446e0bfbd10d925 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 18 Oct 2009 11:58:03 -0600 Subject: [PATCH] Fix #3783 (Die Zeit - Recipe doesn't include full articles) --- resources/recipes/zeitde.recipe | 37 +++++++++++++++++++++++++-------- src/calibre/manual/faq.rst | 5 +++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/resources/recipes/zeitde.recipe b/resources/recipes/zeitde.recipe index 648e3f9148..b086fa8a0f 100644 --- a/resources/recipes/zeitde.recipe +++ b/resources/recipes/zeitde.recipe @@ -15,7 +15,7 @@ class ZeitDe(BasicNewsRecipe): language = 'de' lang = 'de_DE' - __author__ = 'Martin Pitt and Suajta Raman' + __author__ = 'Martin Pitt and Sujata Raman' use_embedded_content = False max_articles_per_feed = 40 remove_empty_feeds = True @@ -41,7 +41,8 @@ class ZeitDe(BasicNewsRecipe): .article{font-family:Georgia,Palatino,Palatino Linotype,FreeSerif,serif;font-size:x-small} .headline iconportrait_inline{font-family:Arial,Helvetica,sans-serif;font-size:x-small} ''' - filter_regexps = [r'ad.de.doubleclick.net/'] + #filter_regexps = [r'ad.de.doubleclick.net/'] + keep_only_tags = [ dict(name='div', attrs={'class':["article"]}) , ] @@ -51,15 +52,32 @@ class ZeitDe(BasicNewsRecipe): dict(name='div', attrs={'id':["place_5","place_4"]}) ] + + def get_article_url(self, article): + + ans = article.get('guid',None) + + try: + self.log('Looking for full story link in', ans) + soup = self.index_to_soup(ans) + x = soup.find(text="Auf einer Seite lesen") + + if x is not None: + + a = x.parent + if a and a.has_key('href'): + ans = a['href'] + self.log('Found full story link', ans) + except: + pass + + if 'video' in ans or 'quiz' in ans : - url = article.get('guid', None) - - if 'video' in url or 'quiz' in url : - - url = None - - return url + ans = None + return ans + + def preprocess_html(self, soup): soup.html['xml:lang'] = self.lang @@ -69,6 +87,7 @@ class ZeitDe(BasicNewsRecipe): return soup + #def print_version(self,url): # return url.replace('http://www.zeit.de/', 'http://images.zeit.de/text/').replace('?from=rss', '') diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 5d0cd842a1..b50d8000e2 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -141,6 +141,11 @@ Now you should be able to access your books on your iPhone by opening Stanza and Replace ``192.168.1.2`` with the local IP address of the computer running |app|. If you have changed the port the |app| content server is running on, you will have to change ``8080`` as well to the new port. The local IP address is the IP address you computer is assigned on your home network. A quick Google search will tell you how to find out your local IP address. +How do I use |app| with my Android phone? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +First install the WordPlayer e-book reading app from the Android Marketplace onto you phone. Then simply plug your phone into the computer with a USB cable. |app| should automatically detect the phone and then you can transfer books to it by clicking the Send to Device button. |app| does not have support for every single androind device out there, so if you would like to have support for your device added, follow the instructions above for getting your device supported in |app|. + I get the error message "Failed to start content server: Port 8080 not free on '0.0.0.0'"? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~