Compare commits
No commits in common. "5faf789e82c33254d9fa40e0d798798173090efc" and "243976511751ccc24a47ad6e464a28e3542e39a4" have entirely different histories.
5faf789e82
...
2439765117
2 changed files with 4 additions and 9 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
*.conf
|
|
||||||
*.txt
|
|
||||||
log/
|
|
||||||
10
discorss.py
10
discorss.py
|
|
@ -14,7 +14,7 @@ import requests
|
||||||
import feedparser
|
import feedparser
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import json
|
import json
|
||||||
# import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
@ -66,10 +66,10 @@ def main():
|
||||||
{
|
{
|
||||||
"title": str(feed.entries[0]["title"]),
|
"title": str(feed.entries[0]["title"]),
|
||||||
"url": str(feed.entries[0]["link"]),
|
"url": str(feed.entries[0]["link"]),
|
||||||
"color": 216128,
|
"color": 5814783,
|
||||||
"footer": {
|
"provider": {
|
||||||
"name": "DiscoRSS",
|
"name": "DiscoRSS",
|
||||||
# "url": "https://git.frzn.dev/amr/discorss",
|
"url": "https://git.frzn.dev/amr/discorss",
|
||||||
},
|
},
|
||||||
"author": {"name": str(hook["name"]), "url": str(hook["siteurl"])},
|
"author": {"name": str(hook["name"]), "url": str(hook["siteurl"])},
|
||||||
"fields": [
|
"fields": [
|
||||||
|
|
@ -92,8 +92,6 @@ def main():
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
hook["webhook"], data=webhook_string, headers=custom_header
|
hook["webhook"], data=webhook_string, headers=custom_header
|
||||||
)
|
)
|
||||||
if r.status_code != '200':
|
|
||||||
print("Error {} while trying to post {}".format(r.status_code, hook["webhook"]))
|
|
||||||
app_config["lastupdate"] = now
|
app_config["lastupdate"] = now
|
||||||
with open(config_file_path, "w") as config_file:
|
with open(config_file_path, "w") as config_file:
|
||||||
json.dump(app_config, config_file, indent=4)
|
json.dump(app_config, config_file, indent=4)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue