View Single Post
Old 08-17-2012, 11:21 AM   #4
nachalca
Junior Member
nachalca began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle
thanks a lot for the responses !!
Irui, your suggestion does not work completely. I am not getting the error message but I can not see the complete articles. Is like I don't have a subscription for the website.


I guess probably the error is in other place, here is the recipe using your sugestion :

from calibre.web.feeds.recipes import BasicNewsRecipe
import mechanize, urllib

class General(BasicNewsRecipe):
title = u'brecha'
description = 'La brecha en tinta electronica'
language = 'es'
timefmt = '[%a, %d %b, %Y]'
needs_subscription = True
oldest_article = 7
max_articles_per_feed = 100
auto_cleanup = True
remove_tags_before = dict(id='article')
remove_tags_after = dict(id='article')


def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None:
cookies = mechanize.CookieJar()
br = mechanize.build_opener(mechanize.HTTPCookieProcess or(cookies))
request = urllib.urlencode([('loginname', self.username), ('password', self.password),])
response = br.open('http://www.brecha.com.uy/index.php/acceder-miembros', request)
return br

feeds = [(u'tapa', u'www.brecha.com.uy/index.php/component/phocagallery/category/1-tapas?format=feed&type=rss'), (u'Politica', u'http://www.brecha.com.uy/index.php/politica-uruguaya?format=feed&type=rss'), (u'Internacionales', u'http://www.brecha.com.uy/index.php/mundo?format=feed&type=rss'), (u'Cultura', u'http://www.brecha.com.uy/index.php/cultura?format=feed&type=rss'), (u'cultura1', u'http://www.brecha.com.uy/index.php/cultura/vueltas-de-montevideo?format=feed&type=rss'), (u'cultura2', u'http://www.brecha.com.uy/index.php/cultura/secos-y-mojados?format=feed&type=rss'), (u'literarias', u'http://www.brecha.com.uy/index.php/cultura/literarias?format=feed&type=rss'), (u'Sociedad', u'http://www.brecha.com.uy/index.php/sociedad?format=feed&type=rss'), (u'Especiales', u'http://www.brecha.com.uy/index.php/especiales?format=feed&type=rss'), (u'Contratapa', u'http://www.brecha.com.uy/index.php/contratapa?format=feed&type=rss')]
nachalca is offline   Reply With Quote