Update website link script
/ lint (push) Failing after 1m8s Details

This commit is contained in:
Jake Howard 2023-07-28 14:54:01 +01:00
parent a1d1c2f96e
commit fc557f00d3
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 3 additions and 5 deletions

View File

@ -3,19 +3,17 @@
import json
import subprocess
import urllib.request
import operator
from collections import OrderedDict
URL = "https://theorangeone.net/index.json"
URL = "https://theorangeone.net/api/page-links/?format=json"
def main():
with urllib.request.urlopen(URL) as response:
data = json.load(response)
data = sorted(data, key=operator.itemgetter("date"), reverse=True)
url_mapping = OrderedDict([
(d['title'], d['url'])
(d['title'], d['full_url'])
for d in data
])