added filtering based on content (#3)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/miniflux-filter#3
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2021-11-02 19:18:26 +01:00
parent e9412d5b64
commit b14609f6ad
2 changed files with 2 additions and 5 deletions

View file

@ -10,7 +10,6 @@
* [Debug](#debug)
* [Exit-Codes](#exit-codes)
* [Build Container](#build-container)
* [ToDo](#todo)
* [License](#license)
<!-- /TOC -->
@ -86,8 +85,5 @@ export MF_DOCKER_HUB_USER=<your_docker_hub_user>
./build.sh
```
## ToDo
- [ ] search in content, not only title
## License
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](./LICENSE) file for details.

View file

@ -11,7 +11,7 @@ MF_FILTERLIST_FILE="${MF_FILTERLIST_FILE:=/data/filter.txt}"
MF_SLEEP="${MF_SLEEP:=30}"
### MF_DEBUG output
# standardmäßig 0 = aus
MF_DEBUG="${MF_[DEBUG]=0}"
MF_DEBUG="${MF_DEBUG=0}"
# Functions
function output_help {
@ -163,6 +163,7 @@ function filter_entries {
fi
# das leerzeichen am anfang ist notwendig, trennt die zahlenwerte
marked_entries+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.title | ascii_downcase | contains($suchbegriff)) | .id' )"
marked_entries+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.content | ascii_downcase | contains($suchbegriff)) | .id' )"
fi
fi
done < "$MF_FILTERLIST_FILE"