Thread: web2lrf
View Single Post
Old 01-10-2008, 12:15 PM   #128
shempe
Junior Member
shempe began at the beginning.
 
Posts: 2
Karma: 19
Join Date: Jan 2008
Location: Hamburg / Germany
Device: Axim x51v and div. other / Sony PRS 505 / Nokia E51
Hi there

here is a quickndirty snippet from me

for germany heise newsticker

its working fine for me

Code:
import re

from libprs500.ebooks.lrf.web.profiles import DefaultProfile

class heise (DefaultProfile):

    title = 'Heise Newsticker'
    max_recursions = 2
    use_pubdate = False
    no_stylesheets = True
    max_articles_per_feed = 30
    
    
    preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in [
    (r'<!-- Site Navigation Bar -->.*?<title>', lambda match : '<title>'),
    (r'</title>.*?</head>', lambda match : '</title> </head>'),
    (r'<!-- allgemeine obere Navigation -->.*?</heisetext>', lambda match : ''),
    (r'<table.*?</table>', lambda match : ''),
    (r'<br clear="all".*?</body>', lambda match : '</div> </body>')
    ] ]

    def get_feeds(self):
        return [ ('Heise Newsticker', 'http://www.heise.de/newsticker/heise.rdf') ]

    def print_version(self, url): 
	        return url.replace('http://www.heise.de/newsticker/meldung/', 'http://www.heise.de/newsticker/meldung/print/')
have fun
Stefan

Last edited by shempe; 01-11-2008 at 12:09 PM.
shempe is offline   Reply With Quote