This commit is contained in:
gauthiier
2019-12-08 21:42:16 +01:00
parent 893515735a
commit 46a0cc8c0b
16 changed files with 1539 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
import os, json, glob, logging
ARCH = "archives/"
EXP = "selection/"
sel = os.path.join(EXP, "tm-selection.js")
def find(li, url):
d = os.path.join(ARCH, li)
if not os.path.isdir(d):
logging.warning("Invalid archive path: " + d)
return None
dir_files = [f for f in glob.glob(os.path.join(d, "*.json"))]
for f in dir_files:
with open(f) as fp:
dj = json.load(fp)
for t in dj['threads']:
if t['url'] == url:
return t
return None
def construct():
dump = {}
with open(sel) as f:
d = json.load(f)
for k, v in d.items():
dump[k] = []
for i in v:
m = find(i['list'], i['url'])
if m is not None:
m['list'] = i['list']
dump[k].append(m)
fout = os.path.join(EXP, "tm-selection-dump.js")
with open(fout, 'w+', encoding='utf-8') as f:
json.dump(dump, f, ensure_ascii=False, indent=4)
if __name__ == "__main__":
construct()
File diff suppressed because one or more lines are too long
+15
View File
@@ -0,0 +1,15 @@
{
"net.art": [
{
"list": "crumb",
"url": "https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1406&L=new-media-curating&F=&S=&P=15160"
}
],
"end2end": [],
"new media art": [
{
"list": "nettime-l",
"url": "https://nettime.org/Lists-Archives/nettime-l-0905/msg00038.html"
}
]
}