This commit is contained in:
parent
a1d1c2f96e
commit
fc557f00d3
1 changed files with 3 additions and 5 deletions
|
@ -3,19 +3,17 @@
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import operator
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
URL = "https://theorangeone.net/index.json"
|
URL = "https://theorangeone.net/api/page-links/?format=json"
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
with urllib.request.urlopen(URL) as response:
|
with urllib.request.urlopen(URL) as response:
|
||||||
data = json.load(response)
|
data = json.load(response)
|
||||||
|
|
||||||
data = sorted(data, key=operator.itemgetter("date"), reverse=True)
|
|
||||||
|
|
||||||
url_mapping = OrderedDict([
|
url_mapping = OrderedDict([
|
||||||
(d['title'], d['url'])
|
(d['title'], d['full_url'])
|
||||||
for d in data
|
for d in data
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue