Archived
1
0
Fork 0

Merge pull request #44 from nijel/patch-1

Add support for string filtering of articles
This commit is contained in:
Lukas Winkler 2020-11-09 13:47:39 +01:00 committed by GitHub
commit 67c711fbcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,6 +46,7 @@ class Site:
github: bool
tags: List[str]
latest_article: Optional[str]
filter: Optional[str]
def load_sites() -> Dict[str, Site]:
@ -57,6 +58,8 @@ def load_sites() -> Dict[str, Site]:
entry["latest_article"] = None
if "github" not in entry:
entry["github"] = None
if "filter" not in entry:
entry["filter"] = None
sites[title] = Site(title, **entry)
return sites
@ -128,6 +131,9 @@ def handle_feed(api: WallabagAPI, site: Site, logger: logging.Logger, config: Co
if article.title == site.latest_article:
logger.debug("already added: " + article.title)
break
if site.filter and not site.filter in article.title:
logger.debug("article filtered: " + article.title)
continue
logger.info("article found: " + article.title)
taglist = [site.title]
if site.tags: