![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle
|
Recipe request from uruguay
Hello, I am from Uruguay, I've just started using calibre.
I am trying to create a recipe for a weakly uruguayan newspaper called Brecha (www.brecha.com.uy), but I am copletely lost. The sites require subscription, I've tried use the new york times example and the Folha do Sao Paulo example, but none of them sees to work here. Could anybody create a recipe for Brecha ? Thank you !! nachalca |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Send me your credentials in private message and I will do it.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
![]() Quote:
Code:
import mechanize, urllib 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.HTTPCookieProcessor(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 |
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() 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')] |
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
Quote:
I will try it again tomorrow, it's time to go to sleep Last edited by lrui; 08-17-2012 at 11:38 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
Quote:
Spoiler:
|
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Recipe for Brecha Digital was added to Calibre tracker. It will be included in the next release. Optional credential entry is provided.
https://bugs.launchpad.net/calibre/+bug/1038516 |
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle
|
OOhh !! Thanks a lot kiklop74 !!
|
![]() |
![]() |
![]() |
Tags |
recipe request, uruguay |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
recipe request | scifiguy51 | Recipes | 0 | 09-07-2011 03:25 PM |
recipe request | chell1948 | Recipes | 1 | 06-02-2011 01:23 PM |
Recipes from newspaper and magazines - Spanish | Uruguay | zeener | Recipes | 5 | 11-24-2010 04:18 PM |
Request for recipe | sumper | Recipes | 2 | 10-11-2010 02:25 AM |
Recipe request please | aessedai44 | Recipes | 2 | 10-06-2010 01:07 AM |