Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
ce71ef1e81 | |||
b72f1d7291 |
2 changed files with 6 additions and 5 deletions
|
@ -23,7 +23,7 @@ Logging was recently enabled. Make sure that the user running the script (especi
|
|||
|
||||
To configure the script, create ~/.config/discorss/discorss.conf with the following structure:
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"feeds": [
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ To automate feed posting, create a systemd service and timer to execute the scri
|
|||
|
||||
Use the command `systemctl --user edit --full --force discorss.service` and then paste in something like this:
|
||||
|
||||
```
|
||||
```systemd
|
||||
[Unit]
|
||||
Description=Discord RSS feeder
|
||||
Wants=discorss.timer
|
||||
|
@ -68,7 +68,7 @@ WantedBy=default.target
|
|||
```
|
||||
|
||||
Make sure to edit the ExecStart to point to the correct location. Then we need a systemd timer to automatically fire the script. Run `systemctl --user edit --full --force discorss.timer` and then paste in this:
|
||||
```
|
||||
```systemd
|
||||
[Unit]
|
||||
Description=Timer for DiscoRSS
|
||||
Requires=discorss.service
|
||||
|
|
|
@ -89,7 +89,7 @@ def setupPaths():
|
|||
Path(config_dir).mkdir(parents=True, exist_ok=True)
|
||||
except FileExistsError:
|
||||
print(
|
||||
"The config dir {} already exists and is not a directory! Please fix manually.".format(
|
||||
"The config dir {} already exists and is not a directory! Please fix manually. Quitting!".format(
|
||||
config_dir
|
||||
)
|
||||
)
|
||||
|
@ -138,11 +138,12 @@ def main():
|
|||
else:
|
||||
continue
|
||||
if bad_time is True:
|
||||
logger.warning(
|
||||
logger.debug(
|
||||
"Feed %s doesn't supply a published time, using updated time instead",
|
||||
hook["name"],
|
||||
)
|
||||
# Hash the title and time of the latest post and use that to determine if it's been posted
|
||||
# Yes, SHA3-512 is totally unnecessary for this purpose, but I love SHA3
|
||||
new_hash = hashlib.sha3_512(
|
||||
bytes(latest_post["title"] + str(published_time), "utf-8")
|
||||
).hexdigest()
|
||||
|
|
Loading…
Add table
Reference in a new issue