From 03ee34189243bd41bc5d649bf7fc00dae9f6db53 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Aug 2011 01:07:41 -0600 Subject: [PATCH] Disable HBR recipes --- recipes/hbr.recipe | 12 +++++++++--- recipes/hbr_blogs.recipe | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/recipes/hbr.recipe b/recipes/hbr.recipe index 214ae14f33..a77c751887 100644 --- a/recipes/hbr.recipe +++ b/recipes/hbr.recipe @@ -11,9 +11,14 @@ class HBR(BasicNewsRecipe): timefmt = ' [%B %Y]' language = 'en' no_stylesheets = True + recipe_disabled = ('hbr.org has started requiring the use of javascript' + ' to log into their website. This is unsupported in calibre, so' + ' this recipe has been disabled. If you would like to see ' + ' HBR supported in calibre, contact hbr.org and ask them' + ' to provide a javascript free login method.') - LOGIN_URL = 'http://hbr.org/login?request_url=/' - LOGOUT_URL = 'http://hbr.org/logout?request_url=/' + LOGIN_URL = 'https://hbr.org/login?request_url=/' + LOGOUT_URL = 'https://hbr.org/logout?request_url=/' INDEX = 'http://hbr.org/archive-toc/BR' @@ -44,7 +49,8 @@ class HBR(BasicNewsRecipe): br['signin-form:username'] = self.username br['signin-form:password'] = self.password raw = br.submit().read() - if 'My Account' not in raw: + open('/t/crap.html', 'wb').write(raw) + if '>Sign out<' not in raw: raise Exception('Failed to login, are you sure your username and password are correct?') try: link = br.find_link(text='Sign out') diff --git a/recipes/hbr_blogs.recipe b/recipes/hbr_blogs.recipe index 0deaef7a73..697b7c5716 100644 --- a/recipes/hbr_blogs.recipe +++ b/recipes/hbr_blogs.recipe @@ -9,6 +9,11 @@ class HBR(BasicNewsRecipe): __author__ = 'Kovid Goyal' language = 'en' no_stylesheets = True + recipe_disabled = ('hbr.org has started requiring the use of javascript' + ' to log into their website. This is unsupported in calibre, so' + ' this recipe has been disabled. If you would like to see ' + ' HBR supported in calibre, contact hbr.org and ask them' + ' to provide a javascript free login method.') LOGIN_URL = 'http://hbr.org/login?request_url=/' LOGOUT_URL = 'http://hbr.org/logout?request_url=/'