37 Commits

Author SHA1 Message Date
4434603b33 Bump pyinstaller from 6.7.0 to 6.8.0 in the python-deps group (#46)
Bumps the python-deps group with 1 update: [pyinstaller](https://github.com/pyinstaller/pyinstaller).


Updates `pyinstaller` from 6.7.0 to 6.8.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.7.0...v6.8.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 19:12:42 +01:00
67c1342ce1 fix: Allow Container CI workflow to continue on error (#47)
Temporary fix for Docker Hub failure.
2024-06-10 19:10:30 +01:00
f8b43a8b79 Bump pyinstaller from 6.6.0 to 6.7.0 in the python-deps group (#45)
Bumps the python-deps group with 1 update: [pyinstaller](https://github.com/pyinstaller/pyinstaller).


Updates `pyinstaller` from 6.6.0 to 6.7.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.6.0...v6.7.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 18:18:15 +01:00
a63da96bd1 Merge pull request #44 from tanrax/dependabot/pip/python-deps-ece60ddaef
Bump lxml from 5.2.1 to 5.2.2 in the python-deps group
2024-05-20 15:25:43 +02:00
9532ff5760 Bump lxml from 5.2.1 to 5.2.2 in the python-deps group
Bumps the python-deps group with 1 update: [lxml](https://github.com/lxml/lxml).


Updates `lxml` from 5.2.1 to 5.2.2
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 04:50:35 +00:00
21610500db Merge pull request #34 from shymega/fix-container-builds-on-forks
Fix container builds on forks by using context vars
2024-05-04 22:16:56 +02:00
1d8d444d2c Merge pull request #42 from shymega/feature/filter-items
Add functionality for filtering feeds.
2024-05-04 22:15:26 +02:00
2555616e65 Bump pyinstaller from 6.5.0 to 6.6.0 in the python-deps group (#43)
Bumps the python-deps group with 1 update: [pyinstaller](https://github.com/pyinstaller/pyinstaller).


Updates `pyinstaller` from 6.5.0 to 6.6.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.5.0...v6.6.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 15:31:00 +01:00
8cd30e8b9e config.yml: Template for filter_strings added
Relates to #32, combined #32 and #31 into one PR.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2024-04-10 22:42:45 +01:00
5e931082e4 rssingle.py: Filter items with filter_strings from config.yml
Relates to #31, combined #31 and #32 into one PR.

NOTE: Edited to remove typo fix, this will be committed later on.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2024-04-10 22:42:30 +01:00
62d93c43b9 Bump the python-deps group with 2 updates (#41)
Bumps the python-deps group with 2 updates: [listparser](https://github.com/kurtmckee/listparser) and [lxml](https://github.com/lxml/lxml).


Updates `listparser` from 0.19.0 to 0.20
- [Release notes](https://github.com/kurtmckee/listparser/releases)
- [Changelog](https://github.com/kurtmckee/listparser/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/kurtmckee/listparser/compare/v0.19...v0.20)

Updates `lxml` from 5.1.0 to 5.2.1
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.1.0...lxml-5.2.1)

---
updated-dependencies:
- dependency-name: listparser
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 22:41:02 +01:00
e17c396fb2 fix(typo): Fix typo in script 2024-04-10 22:40:37 +01:00
768ca68241 Bump the python-deps group with 1 update (#39)
Bumps the python-deps group with 1 update: [pyinstaller](https://github.com/pyinstaller/pyinstaller).


Updates `pyinstaller` from 6.4.0 to 6.5.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.4.0...v6.5.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 19:09:12 +00:00
34b4ae3e2b Bump the python-deps group with 1 update (#38)
Bumps the python-deps group with 1 update: [python-dateutil](https://github.com/dateutil/dateutil).


Updates `python-dateutil` from 2.8.2 to 2.9.0.post0
- [Release notes](https://github.com/dateutil/dateutil/releases)
- [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS)
- [Commits](https://github.com/dateutil/dateutil/compare/2.8.2...2.9.0.post0)

---
updated-dependencies:
- dependency-name: python-dateutil
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 16:42:24 +00:00
4ab9bc864f Bump the python-deps group with 1 update (#37)
Bumps the python-deps group with 1 update: [pyinstaller](https://github.com/pyinstaller/pyinstaller).


Updates `pyinstaller` from 6.3.0 to 6.4.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.3.0...v6.4.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 19:43:52 +00:00
8e5e7646ce Bump the python-deps group with 1 update (#36)
Bumps the python-deps group with 1 update: [lxml](https://github.com/lxml/lxml).


Updates `lxml` from 5.0.1 to 5.1.0
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.0.1...lxml-5.1.0)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 19:34:40 +00:00
ab3c1b4610 Bump the python-deps group with 1 update (#35)
Bumps the python-deps group with 1 update: [lxml](https://github.com/lxml/lxml).


Updates `lxml` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.0.0...lxml-5.0.1)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 17:42:16 +00:00
84b108e154 Fix container builds on forks by using context vars
Also add conditional to only build containers on the upstream repo.
2024-01-03 20:24:55 +00:00
e9980668c4 Bump the python-deps group with 1 update (#33)
Bumps the python-deps group with 1 update: [lxml](https://github.com/lxml/lxml).


Updates `lxml` from 4.9.4 to 5.0.0
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.9.4...lxml-5.0.0)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-01 19:08:10 +00:00
c1aa3e59d1 Merge pull request #3 from shymega/shymega/prs/ci
Initial version of CI for RSSingle
2023-12-29 11:54:45 +01:00
6be4933a9a Merge pull request #30 from tanrax/dependabot/pip/python-deps-0d001ee384
Bump the python-deps group with 5 updates
2023-12-29 11:54:10 +01:00
cfd6bddafc Merge pull request #5 from shymega/shymega/prs/docker
Add Docker support for RSSingle, and a workflow for builds
2023-12-29 11:53:56 +01:00
4b5c774324 Bump the python-deps group with 5 updates
Bumps the python-deps group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [feedgen](https://github.com/lkiesow/python-feedgen) | `0.9.0` | `1.0.0` |
| [feedparser](https://github.com/kurtmckee/feedparser) | `6.0.10` | `6.0.11` |
| [lxml](https://github.com/lxml/lxml) | `4.9.3` | `4.9.4` |
| [pyyaml](https://github.com/yaml/pyyaml) | `6.0` | `6.0.1` |
| [pyinstaller](https://github.com/pyinstaller/pyinstaller) | `6.0.0` | `6.3.0` |


Updates `feedgen` from 0.9.0 to 1.0.0
- [Release notes](https://github.com/lkiesow/python-feedgen/releases)
- [Commits](https://github.com/lkiesow/python-feedgen/compare/v0.9.0...v1.0.0)

Updates `feedparser` from 6.0.10 to 6.0.11
- [Changelog](https://github.com/kurtmckee/feedparser/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/kurtmckee/feedparser/compare/6.0.10...6.0.11)

Updates `lxml` from 4.9.3 to 4.9.4
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.9.3...lxml-4.9.4)

Updates `pyyaml` from 6.0 to 6.0.1
- [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0...6.0.1)

Updates `pyinstaller` from 6.0.0 to 6.3.0
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v6.0.0...v6.3.0)

---
updated-dependencies:
- dependency-name: feedgen
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: python-deps
- dependency-name: feedparser
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-deps
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-deps
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-deps
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-29 10:52:44 +00:00
e03fff3a42 Merge pull request #29 from shymega/shymega/prs/group-dependabot-updates
feat(CI/dependabot): Group Dependabot PRs
2023-12-29 11:51:02 +01:00
b7cfae13e1 feat(CI/dependabot): Group Dependabot PRs
To reduce maintainer workload, I've made this PR for Dependabot to
automatically group related PRs together into one PR.

We could also enable a workflow to automatically merge Dependabot PRs,
on the condition that the code continues to compile and produce a
unified RSS XML feed.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2023-12-25 20:25:35 +00:00
57ed8aef3a Start testing release packager 2023-12-25 20:25:23 +00:00
b526fc582f Initial version of CI for RSSingle
Hi @tanrax!

As part of our new collaboration, I've made an initial version for
automated CI for RSSingle.

It needs macOS to work first, so I've commented out a draft version of
the `pyinstaller` aspect, so I'll make this PR a draft for now when we
can discuss further, preferably in a GH issue for transparency (unless
you want it private?), but this workflow tests on PRs and pushes to any
branch, with flake8 across multiple Python versions. The pyinstaller
aspect only runs if the flake8 check passes.

What do you think?

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2023-12-25 20:25:23 +00:00
f7a2c2417e Merge pull request #16 from tanrax/add-limit-entries
Add limit entries
2023-10-26 14:53:37 +02:00
0dfb71de00 Merge branch 'master' into add-limit-entries 2023-10-26 14:53:27 +02:00
124a57c033 Merge pull request #18 from tanrax/fix-format-error
Fix format error
2023-10-26 14:52:35 +02:00
16e80795cd Merge pull request #19 from tanrax/dependabot/pip/lxml-4.9.3
Bump lxml from 4.9.2 to 4.9.3
2023-10-26 14:52:05 +02:00
4cd87527bd Merge pull request #23 from tanrax/dependabot/pip/pyinstaller-6.0.0
Bump pyinstaller from 5.13.0 to 6.0.0
2023-10-26 14:51:30 +02:00
0a075bbdc9 Bump pyinstaller from 5.13.0 to 6.0.0
Bumps [pyinstaller](https://github.com/pyinstaller/pyinstaller) from 5.13.0 to 6.0.0.
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v5.13.0...v6.0.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 04:44:00 +00:00
62f24bb204 Bump lxml from 4.9.2 to 4.9.3
Bumps [lxml](https://github.com/lxml/lxml) from 4.9.2 to 4.9.3.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.9.2...lxml-4.9.3)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 04:25:27 +00:00
dd16696103 Add var config max entries
Use `max_entries` as YAML key.

Co-authored-by: Dom Rodriguez <shymega@shymega.org.uk>
2023-07-06 18:11:15 +01:00
1f36dea889 Adjust branch, assumed the branch - use master
I didn't realise you were using `master` as the branch name, so this
wouldn't run if the PR was accepted.

Now fixed.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2022-09-12 23:45:26 +01:00
daf79338b5 Add Docker support for RSSingle, and a workflow for builds
This commit adds a Dockerfile, .dockerignore, and a GH Action for
pushing container images to - and this is by default, other registries
can be used - Docker Hub (you need to generate a token and install it in
the repo), and GitHub Registry, which doesn't require a manual token.

The workflow won't build until #3 is merged, as it relies on successful
builds from that workflow before a container image is pushed. Once we use unit
tests, this will ensure container images aren't broken when pushed to a
remote registry.

I have marked this PR as draft for that reason.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2022-09-12 22:09:57 +01:00
9 changed files with 166 additions and 12 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
/LICENSE
/README.md
/rssingle.png
/Dockerfile
/config.yml

View File

@ -4,8 +4,16 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
groups:
gh-actions-deps:
patterns:
- "*"
- package-ecosystem: "pip" - package-ecosystem: "pip"
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
groups:
python-deps:
patterns:
- "*"

59
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: CI workflow for RSSingle
on: [push, pull_request]
jobs:
build-and-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# to be completed once macOS builds fixed
create-and-publish-release:
needs: build-and-check
if: startsWith(github.ref, 'refs/tags/') && success()
strategy:
matrix:
# `--windowed` is for macOS, and `--onefile` is for other OSes.
pyinstaller-type: ['--windowed', '--onefile']
runner: ["macos-latest", "windows-latest", "ubuntu-latest"]
runs-on: ${{ matrix.runner }}
name: Builder for Python all-in-one executables, published on a release.
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt
- name: Build RSSingle (Windows, Linux)
if: ${{ matrix.runner != 'macos-latest' }}
run: pyinstaller --onefile ./rssingle.py
- name: Build RSSingle (macOS)
if: ${{ matrix.runner == 'macos-latest' }}
run: pyinstaller --windowed ./rssingle.py
- name: List artifacts for finishing this action
run: find ./dist/

45
.github/workflows/container.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Container image builder for RSS single
on:
workflow_run:
workflows: ["CI workflow for RSSingle"]
types: [completed]
branches: [master]
jobs:
build-and-push-container-image:
name: Build and push container image to Docker Hub and GHCR.io
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'tanrax/RSSingle' }}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Build container image
id: build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ github.repository }}
tags: latest
containerfiles: Dockerfile
- name: Push container image to Docker Hub
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: docker.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push container image to GHCR.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM docker.io/python:3.8-buster AS base
FROM base AS build
WORKDIR /work
COPY . .
RUN pip3 install pyinstaller
RUN pip3 install -r /work/requirements.txt
RUN pyinstaller --onefile /work/rssingle.py
FROM docker.io/python:3.8-buster AS app
COPY --from=build /work/dist/rssingle /rssingle
ENTRYPOINT ["/rssingle"]

View File

@ -35,6 +35,7 @@ title: My RSS Feed
description: My customised RSS feed with technology news description: My customised RSS feed with technology news
url: https://www.example.com url: https://www.example.com
output: rss.xml output: rss.xml
max_entries: 5 # Delete this line to get all
feeds: feeds:
- https://programadorwebvalencia.com/feed/ - https://programadorwebvalencia.com/feed/
- https://republicaweb.es/feed/ - https://republicaweb.es/feed/
@ -49,7 +50,7 @@ curl -o config.yml https://raw.githubusercontent.com/tanrax/RSSingle/master/conf
4. Run the binary. 4. Run the binary.
``` shell ``` shell
./rssingle ./rssingle
``` ```
A file called `rss.xml` will be created. A file called `rss.xml` will be created.

View File

@ -2,6 +2,10 @@ title: My RSS Feed
description: My customised RSS feed with technology news description: My customised RSS feed with technology news
url: https://www.example.com url: https://www.example.com
output: rss.xml output: rss.xml
max_entries: 2 # Delete this line to get all
feeds: feeds:
- https://programadorwebvalencia.com/feed/ - https://programadorwebvalencia.com/feed/
- https://republicaweb.es/feed/ - https://republicaweb.es/feed/
filter_strings:
- unwanted
- exclude_this

View File

@ -1,7 +1,7 @@
feedgen==0.9.0 feedgen==1.0.0
feedparser==6.0.10 feedparser==6.0.11
listparser==0.19.0 listparser==0.20
lxml==4.9.2 lxml==5.2.2
python-dateutil==2.8.2 python-dateutil==2.9.0.post0
pyyaml==6.0 pyyaml==6.0.1
pyinstaller==5.13.0 pyinstaller==6.8.0

View File

@ -15,7 +15,7 @@ import json
import yaml import yaml
# Varaibles # Variables
log = None log = None
CONFIG_PATH = "config.yml" CONFIG_PATH = "config.yml"
@ -87,6 +87,16 @@ def parse_rss_feed(url) -> feedparser.FeedParserDict:
log.warning("Failed to parse RSS feed.") log.warning("Failed to parse RSS feed.")
# Now, we could handle gracefully. # Now, we could handle gracefully.
def filter_feed_entries(entry) -> bool:
"""
This function filters feed entries based on strings defined in config.yml.
"""
filter_strings = CONFIG.get("filter_strings", [])
for filter_str in filter_strings:
if filter_str.lower() in entry.get("title", "").lower() or filter_str.lower() in entry.get("summary", "").lower():
log.debug(f"Entry filtered out: {entry['title']}")
return False
return True
def main(): def main():
log.debug("Loading feed list into memory..") log.debug("Loading feed list into memory..")
@ -96,14 +106,18 @@ def main():
for feed in CONFIG["feeds"]: for feed in CONFIG["feeds"]:
rss = parse_rss_feed(feed) rss = parse_rss_feed(feed)
entries = rss.get("entries") entries = rss.get("entries")
log.debug(f"Iterating over {feed} feed entries..") log.debug("Iterating over [input] feed entries..")
for entry in entries: for entry in entries[:CONFIG["max_entries"]] if "max_entries" in CONFIG else entries:
log.debug("New feed entry created.") log.debug("New feed entry created.")
if not filter_feed_entries(entry):
continue # Skip this entry
fe = fg.add_entry() fe = fg.add_entry()
log.debug("Working on new feed entry..") log.debug("Working on new feed entry..")
try: try:
fe.id(entry["id"]) fe.id(entry["id"])
except KeyError: except KeyError: