Small library to filter Nextcloud News feeds
Project description
Nextcloud News Filter
This library is designed to filter Feeds from Nextcloud News, by marking them as read. It is originally based on nextcloud-news-filter by mathisdt.
State of this package
This package is in an early stage of development. Things like configuration may change heavily in this early stage.
Usage
This can be used directly on the system via a cli or as serverless function
Installation
CLI
If you want to use the CLI install it with pipx install nextcloud_news_filter[cli]
Scaleway Serverless function
A full documentation will follow. These are just the steps you need to follow.
- create a namespace
- add a function via UI
- Get the last Release file: nextcloud_news_filter-$TAG.zip
- upload this via UI or with
scw
cli - add your credentials as variables/secrets
- create a cron trigger with your filter configuration
Configuration
All settings concerning the nextcloud server is done via environment variables:
- NEXTCLOUD_URL - the url of your instance e.g 'https://nextcloud.example.com'
- NEXTCLOUD_USER - your username
- NEXTCLOUD_PASS - the password of your user
It is using Basic authentication, if you have enabled 2-factor-authentication it will probably not work
Filter
The json to configure your filters consists of two keys
skipFeeds
to ignore Feeds from all filters.
and filter
to actually filter feeds. These are the options:
- name: Name of the filter. Mandatory
- feedId: Id of the feed the filter should be limited to (if not there, the filter rule is applied to all feeds). Optional
- bodyRegex: Regex that is applied to search in body of the feed item. Optional
- titleRegex: Regex that is applied to search in the title of the feed entry. Optional
- hoursAge: Maximum lifetime of the feed entry.
Example:
{
"skipFeeds": [
1678, 1683, 1681, 1682, 1684, 1680, 1659, 1654, 1658, 1657, 1656, 1660, 1655
],
"filter": [
{
"name": "heise+",
"feedId": 1592,
"titleRegex": "heise\\+|heise\\-Angebot|TechStage"
},
{
"name": "All with Advertisement in Body",
"feedId": 1594,
"bodyRegex": "^Advertisement: "
},
{
"name": "Feed older then one day, for feed 1595",
"feedId": 1595,
"hoursAge": 24
},
{
"name": "all > 20 Days all feeds (except for skipped ones)",
"hoursAge": 480
}
]
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nextcloud_news_filter-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ccf079b18034c36901bfa69d7f9a5a80bdcf21aaaa70c728d29c97844e10b2 |
|
MD5 | 708604ebb0a3ac15978e83d160b80403 |
|
BLAKE2b-256 | 95e3d18a6a8d2da52ebbde604552ccd2fca1ae18ddd990444ef67a6d45f3ae58 |
Hashes for nextcloud_news_filter-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f64c68572aae997553e0fcd7b913ed4a361eadfa3175700048d8eb0ccb29b0 |
|
MD5 | bc87263a625b6325b576038c14b2b1ea |
|
BLAKE2b-256 | 88be7bba82dc7e770f3ef4b485ec6fdff2268d3164c126e86401c3003b8cb885 |