From fc557f00d38117c773b6a4c934f471675373c2a9 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 28 Jul 2023 14:54:01 +0100 Subject: [PATCH] Update website link script --- files/bin/website-link | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/files/bin/website-link b/files/bin/website-link index 1522f83..47c90de 100755 --- a/files/bin/website-link +++ b/files/bin/website-link @@ -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 ])