| 1 |
#!/usr/bin/env python |
| 2 |
# vim:fileencoding=utf-8 |
| 3 |
from __future__ import absolute_import, division, print_function, unicode_literals |
| 4 |
|
| 5 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 6 |
|
| 7 |
|
| 8 |
class AdvancedUserRecipe(BasicNewsRecipe): |
| 9 |
title = 'Macrobusiness' |
| 10 |
language = 'en_AU' |
| 11 |
__author__ = '2018robert' |
| 12 |
oldest_article = 1 |
| 13 |
max_articles_per_feed = 100 |
| 14 |
auto_cleanup = True |
| 15 |
needs_subscription = 'optional' |
| 16 |
|
| 17 |
feeds = [ |
| 18 |
('Macrobusiness', 'https://www.macrobusiness.com.au/feed'), |
| 19 |
] |
| 20 |
|
| 21 |
def get_browser(self): |
| 22 |
br = BasicNewsRecipe.get_browser(self) |
| 23 |
if self.username is not None and self.password is not None: |
| 24 |
br.open('https://www.macrobusiness.com.au/my-account/') |
| 25 |
br.select_form(class_=lambda x: 'login' in x) |
| 26 |
br['username'] = self.username |
| 27 |
br['password'] = self.password |
| 28 |
br.submit() |
| 29 |
return br |