mirror of https://github.com/tildeclub/site.git
Update gen_tdp
Added features=xml to fix python warnings.
This commit is contained in:
parent
d28b3c4041
commit
7d82a258c7
9
gen_tdp
9
gen_tdp
|
@ -17,10 +17,10 @@ for user in users:
|
||||||
tdpuser = dict(username=user)
|
tdpuser = dict(username=user)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
title = bs(
|
title = bs(
|
||||||
requests.get(f"http://tilde.club/~{user}/", allow_redirects=False).text,
|
requests.get(f"http://tilde.club/~{user}/", allow_redirects=False).text,
|
||||||
"lxml",
|
"lxml", features='xml'
|
||||||
).title.text
|
).title.text
|
||||||
except:
|
except:
|
||||||
title = "No title"
|
title = "No title"
|
||||||
tdpuser["title"] = title
|
tdpuser["title"] = title
|
||||||
|
@ -36,4 +36,3 @@ tdp["users"] = tdpusers
|
||||||
|
|
||||||
with open("tilde.json", "w") as f:
|
with open("tilde.json", "w") as f:
|
||||||
json.dump(tdp, f)
|
json.dump(tdp, f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue