Import from Codeberg

This commit is contained in:
Ivanq 2021-03-25 22:33:30 +03:00
parent 5715d92225
commit 99a8680788
8 changed files with 35 additions and 0 deletions

2
_data/signed/Digit.yaml Normal file
View File

@ -0,0 +1,2 @@
name: Digit
link: https://notabug.org/Digit

View File

@ -0,0 +1,2 @@
name: basedCow
link: https://codeberg.org/basedCow

2
_data/signed/neox_.yaml Normal file
View File

@ -0,0 +1,2 @@
name: Adrien Bourmault
link: https://gitlab.os-k.eu/neox

View File

@ -0,0 +1,2 @@
name: Julian Barathieu
link: https://gitlab.os-k.eu/spectral

View File

@ -0,0 +1,2 @@
name: theundercoverman
link: https://theundercoverman.codeberg.page/

2
_data/signed/tonib.yaml Normal file
View File

@ -0,0 +1,2 @@
name: Toni Bryan
link: https://codeberg.org/tonib

2
_data/signed/zleap.yaml Normal file
View File

@ -0,0 +1,2 @@
name: Paul Sutton
link: https://codeberg.org/zleap

21
import-from-codeberg.py Normal file
View File

@ -0,0 +1,21 @@
import requests
import os
page = 1
while True:
comments = requests.get(f"https://codeberg.org/api/v1/repos/rms-support-letter/rms-support-letter/issues/comments?page={page}").json()
if not comments:
break
for comment in comments:
author = comment["user"]["login"]
content = comment["body"]
content_lines = [line.strip() for line in content.replace("`", "").strip().split("\n") if line.strip()]
for i in range(len(content_lines) - 1):
if content_lines[i].lower().startswith("name:") and content_lines[i + 1].lower().startswith("link:"):
if not os.path.isfile(f"_data/signed/{author}.yaml"):
with open(f"_data/signed/{author}.yaml", "w") as f:
f.write("name:" + content_lines[i][5:] + "\nlink:" + content_lines[i + 1][5:] + "\n")
page += 1