Commit graph

46 commits

Author SHA1 Message Date
85d13b9309
bump version to 0.3rc1 2026-04-24 16:02:56 -04:00
cdd7a2569f
log: change error printing to logging 2026-04-24 15:53:02 -04:00
63300e6012
logging: update logging levels and added new messages 2026-04-24 10:51:59 -04:00
98d1a3ba45
args: implemented argparse for config file, log, and dry run 2026-04-24 10:31:07 -04:00
5a3e3333b3
hash: added FIFO for hashes, should reduce duplicates 2026-04-24 10:26:26 -04:00
d412c1a378
hash: updated hash to use URL. also added DRY_RUN option 2026-04-24 10:23:18 -04:00
02aa1aa11b
hash: remove time from hash, now title only 2026-04-13 15:26:35 -04:00
c385b3266c
async: complete rewrite as async code 2026-04-12 14:37:39 -04:00
A.M. Rowsell
1abda8d6e4
Small comment updates 2025-06-20 14:14:47 -04:00
A.M. Rowsell
e4539b5733
chore: rename function, move some init code
Also switching logging back to ERROR from DEBUG. The solution
to the lockups for now is to just use systemd timer timeouts.
2025-04-22 02:11:01 -04:00
A.M. Rowsell
2b4e4216f4
release: bump version number to 0.2 2025-04-20 16:10:08 -04:00
A.M. Rowsell
087a6339c8
class refactor: Squashed commit of the following:
commit 597f383724
Author: A.M. Rowsell <amrowsell@frozenelectronics.ca>
Date:   Sun Apr 20 16:04:00 2025 -0400

    fix: typo in log setup, error when replacing w/self

commit 810cbd6f3d
Author: A.M. Rowsell <amrowsell@frozenelectronics.ca>
Date:   Sun Apr 20 13:51:41 2025 -0400

    refactor: transformed into class-based app
2025-04-20 16:06:16 -04:00
A.M. Rowsell
a62a0fcdc3
debug: added more logging to narrow down issue 2025-04-20 13:30:43 -04:00
A.M. Rowsell
af51c317e2
bug: trying to track down lock-up bug
For some reason the script seems to be occasionally locking up,
and then because the systemd service state is stuck in "starting"
it never finishes which means the timer never gets reset.

Adding some debug statements to try and figure out the cause.
Also changed logging to DEBUG level. I'd much rather fix the
bug but a timeout would also solve the issue.
2025-04-19 12:45:07 -04:00
A.M. Rowsell
f70b18040a
fix: wrapped hash in try/except to detect empty feeds
Also changed file mode of install.sh to +x
2025-04-19 09:04:42 -04:00
A.M. Rowsell
ce71ef1e81
chore: Changed warning text, and some logging values 2025-03-16 02:20:10 -04:00
A.M. Rowsell
457e2c3315
feat: rewrote get_description to allow extra text
Now if you want to add something to the end of the description,
you can pass it via the addons parameter. Also moved a line
that was duplicated to reduce the function length.
2025-03-06 20:11:51 -05:00
A.M. Rowsell
9a5c4616e3
Finished description cutoff detection.
Added min_length parameter, as well as an addon parameter that
might be used in the future to add extra text to the description
where needed.

Next up will be checking for media in the entry and adding a
second embed field or attachment so the media can be previewed
or listened to/watched right in the Discord post.
2025-03-04 16:36:01 -05:00
A.M. Rowsell
8129da759f
Trying to make description cutoff smarter. Changed hashing.
Hashing now takes the sha3_512 hash of both the title and
the published time, because some feeds (like weather alerts)
will have the same title all the time, for every entry.

The description cutoff now goes backwards until it finds a
space character, then it sets the cutoff there. Also, the
length can now be passed as a parameter, with default value
of 250. Might also add minimum length as a parameter too.
2025-03-04 16:27:06 -05:00
A.M. Rowsell
8ff64608cd
Fixed html regex filter. Edited some logging types. See full msg.
The HTML regex wasn't working because I was missing some
really obvious capture groups. The regex filter is really only
for the kernel.org Releases Feed, just to make it look a bit
cleaner. We don't actually need the direct links because the
post's title already links directly to the front page. We mostly
just want to know there's been a release.

Some logging parameters were changed to make the log less
cluttered by default. Going to write a logrotate config that
will be included in the README or something to help people with
rotating the logs automatically. Also added a few small
clarifying comments, as well as an IDEA!
2025-03-03 07:41:41 -05:00
A.M. Rowsell
1c78edd38e
Fixed status code checking 2025-02-26 20:12:29 -05:00
A.M. Rowsell
7d84c7c257
Bump version to v0.2rc3 2025-02-26 17:44:39 -05:00
A.M. Rowsell
0a22cfe4ee
A few small cleanup items 2025-02-25 20:57:40 -05:00
A.M. Rowsell
a263f5cb93
FEATURE: Added logging, finally!
Now the log_dir and log_file_path actually do something useful.
2025-02-25 20:56:37 -05:00
A.M. Rowsell
3def57a933
Quick and dirty hack to check for latest post in a feed
This is needed in case the feed is not in reverse chronological
order, like most feeds. This needs testing still.
2025-02-25 18:15:10 -05:00
A.M. Rowsell
a1a6998e52
Split out config file handling into its own function 2025-02-25 18:14:37 -05:00
A.M. Rowsell
8229a14cfe
Cleaned up file/dir paths a bit, make app_config global
app_config is global pending the next commit which will
separate out all the config file handling from main() as the
LSP was saying the main function had become too complex.
2025-02-25 18:13:01 -05:00
A.M. Rowsell
bb3edcbfc7
Various small fixes, see full commit message
* Changed the preview length to 250 characters
* Changed the version in the user-agent string
* Cleaned up paths, switching to user paths
* Updated html regex filter to correctly remove : . /
* Various formatting changes from black
* Wrapped published_time in try/except
2025-02-13 21:16:55 -05:00
A.M. Rowsell
d15578f7b2
Changed formatting, added some comments, moved config file location 2025-02-07 20:24:14 -05:00
A.M. Rowsell
5c91dccc9e Merge branch 'main' into hash 2025-02-05 23:41:23 -05:00
A.M. Rowsell
a188f8ee5d
Removed part of time check 2025-02-05 23:40:27 -05:00
A.M. Rowsell
87193d0f94
Added sha3_512 hash of post title, to migrate from using time 2025-02-05 23:28:14 -05:00
A.M. Rowsell
bd693f6f42
Added check for non-existant lastupdate key 2025-02-05 23:27:49 -05:00
A.M. Rowsell
ec88faa437
Changed HTTP status code checking to catch success codes other than 200 2025-02-05 15:30:34 -05:00
A.M. Rowsell
8683d08d1c
First attempt at hash-based feed tracking 2025-02-05 15:29:04 -05:00
A.M. Rowsell
30756fc462
Added HTML filter, removed duplicate titles in embed, better output 2025-02-03 14:34:15 -05:00
A.M. Rowsell
422a717526
Changed embed colour, footer, removed datetime, added error detection 2025-02-02 11:21:52 -05:00
A.M. Rowsell
da7ec6ddda
Made variable names consistent. Added MPL-2.0 text header. 2025-01-31 23:35:02 -05:00
A.M. Rowsell
22e4294469
Added back correct provider, as well as author fields 2025-01-31 16:28:04 -05:00
A.M. Rowsell
c5cb655943
Increased description length again to 150. 2025-01-31 16:27:44 -05:00
A.M. Rowsell
bd2af92ec9
First working version! Woo!
I figured out what the issue was. Discord was trying to tell
me there was a problem with the embed I was sending. The provider
value was removed, and with some other tweaks it all started
working. Heavy, heavy facepalm.
2025-01-31 16:17:13 -05:00
A.M. Rowsell
e6c43876ac
Changed getDescription() to limit description string length
Now it will print at most 100 characters, though at some point
I might add something to break the string at the end of a sentence.
2025-01-31 16:16:27 -05:00
A.M. Rowsell
38e78bcdf4
Still debugging errors, seems to be json encoding issue? 2025-01-30 16:28:30 -05:00
A.M. Rowsell
35c3e11b6e
Added encoding string, comments 2025-01-30 16:28:11 -05:00
A.M. Rowsell
cdbaa552fb
Added User-Agent header, still getting 405s 2025-01-29 20:13:48 -05:00
A.M. Rowsell
8079f07c41
First commit of DiscoRSS project
For some reason we are getting 400s from Discord. I suspect
it's a Cloudflare thing.
2025-01-27 16:51:46 -05:00