View Single Post
Old 02-17-2009, 07:56 PM   #239
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,426
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Hypernova View Post
Code:
import re

class AdvancedUserRecipe1234495609(BasicNewsRecipe):
    title          = u'Physicsworld'
    oldest_article = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    remove_javascript     = True
    remove_tags_before = dict(name='h1')
    remove_tags_after = [dict(name='div', attrs={'id':'shareThis'})]
    preprocess_regexps = [
   (re.compile(r'<div id="shareThis">.*</body>', re.DOTALL|re.IGNORECASE),
    lambda match: '</body>'),
]    
    feeds          = [
                          (u'Headlines News', u'http://feeds.feedburner.com/PhysicsWorldNews')
                      ]
Note that to ensure that calibre can get all the article, you need to login. Making a custom recipe with login is, however, beyond my skill.
The next release of calibre will have a recipe for physics world with login
kovidgoyal is offline