From e02d86fe906f1b01b798e59ccaa61fd766288d78 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 14:42:16 -0600 Subject: [PATCH] update NIN Online. Fixes #5547 (Updated recipe for NIN online) --- resources/recipes/nin.recipe | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/resources/recipes/nin.recipe b/resources/recipes/nin.recipe index 9e1aa57733..70fd998a09 100644 --- a/resources/recipes/nin.recipe +++ b/resources/recipes/nin.recipe @@ -5,7 +5,7 @@ __copyright__ = '2008-2010, Darko Miletic ' www.nin.co.rs ''' -import re, urllib +import re from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe @@ -16,13 +16,13 @@ class Nin(BasicNewsRecipe): publisher = 'NIN d.o.o.' category = 'news, politics, Serbia' no_stylesheets = True + delay = 1 oldest_article = 15 encoding = 'utf-8' needs_subscription = True remove_empty_feeds = True PREFIX = 'http://www.nin.co.rs' INDEX = PREFIX + '/?change_lang=ls' - LOGIN = PREFIX + '/?logout=true' use_embedded_content = False language = 'sr' publication_type = 'magazine' @@ -41,14 +41,12 @@ class Nin(BasicNewsRecipe): def get_browser(self): br = BasicNewsRecipe.get_browser() - br.open(self.INDEX) if self.username is not None and self.password is not None: - data = urllib.urlencode({ 'login_name':self.username - ,'login_password':self.password - ,'imageField.x':'32' - ,'imageField.y':'15' - }) - br.open(self.LOGIN,data) + br.open(self.INDEX) + br.select_form(name='form1') + br['login_name' ] = self.username + br['login_password'] = self.password + br.submit() return br keep_only_tags =[dict(name='td', attrs={'width':'520'})]