backend newsfeed version is 0.3 (conforming to weboob version)
This commit is contained in:
parent
1be1af5a5d
commit
fe39601810
3 changed files with 15 additions and 19 deletions
|
|
@ -44,7 +44,7 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost):
|
|||
BROWSER = DLFP
|
||||
RSS_TELEGRAMS= "https://linuxfr.org/backend/journaux/rss20.rss"
|
||||
RSS_NEWSPAPERS = "https://linuxfr.org/backend/news/rss20.rss"
|
||||
|
||||
|
||||
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['username'], self.config['password'])
|
||||
|
|
@ -55,7 +55,7 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost):
|
|||
whats.add(self.RSS_NEWSPAPERS)
|
||||
if self.config['get_telegrams']:
|
||||
whats.add(self.RSS_TELEGRAMS)
|
||||
|
||||
|
||||
|
||||
for what in whats:
|
||||
for article in Newsfeed(what, url2id).iter_entries():
|
||||
|
|
|
|||
|
|
@ -18,29 +18,29 @@
|
|||
|
||||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.capabilities.messages import ICapMessages, Message, Thread
|
||||
from weboob.tools.newsfeed import Newsfeed
|
||||
from weboob.tools.newsfeed import Newsfeed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class NewsfeedBackend(BaseBackend, ICapMessages):
|
||||
NAME = 'newsfeed'
|
||||
MAINTAINER = u"Clément Schreiner"
|
||||
EMAIL = "clemux@clemux.info"
|
||||
VERSION = "0.1"
|
||||
VERSION = "0.3"
|
||||
DESCRIPTION = "Loads RSS and Atom feeds from any websites"
|
||||
LICENSE = "GPLv3"
|
||||
CONFIG = {'url': BaseBackend.ConfigField(description="Atom/RSS feed's url"),}
|
||||
STORAGE = {'seen': []}
|
||||
|
||||
|
||||
|
||||
|
||||
def iter_threads(self):
|
||||
for article in Newsfeed(self.config["url"]).iter_entries():
|
||||
thread = Thread(article.id)
|
||||
thread.title = article.title
|
||||
yield thread
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_thread(self, id):
|
||||
if isinstance(id, Thread):
|
||||
|
|
@ -68,8 +68,8 @@ class NewsfeedBackend(BaseBackend, ICapMessages):
|
|||
children=[],
|
||||
flags=flags)
|
||||
return thread
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def iter_unread_messages(self, thread=None):
|
||||
for thread in self.iter_threads():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue