This commit is contained in:
47
scripts/generate_contact.py
Normal file
47
scripts/generate_contact.py
Normal file
@ -0,0 +1,47 @@
|
||||
import base64
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
raw_contact: list[dict[str, str]] = [
|
||||
{
|
||||
"platform": "Github",
|
||||
"href": "https://github.com/passthem-desu",
|
||||
"name": "passthem-desu",
|
||||
},
|
||||
{
|
||||
"platform": "Wakatime",
|
||||
"href": "https://wakatime.com/@passthem",
|
||||
"name": "@passthem",
|
||||
},
|
||||
{
|
||||
"platform": "Youtube",
|
||||
"href": "https://www.youtube.com/@Passthem183",
|
||||
"name": "@Passthem183",
|
||||
},
|
||||
{
|
||||
"platform": "OtoSite",
|
||||
"href": "https://otomad.site/@passthem",
|
||||
"name": "@passthem",
|
||||
},
|
||||
{
|
||||
"platform": "Email",
|
||||
"href": "mailto:passthem183@gmail.com",
|
||||
"name": "passthem183@gmail.com",
|
||||
},
|
||||
{
|
||||
"platform": "Bilibili",
|
||||
"href": "https://space.bilibili.com/92852604",
|
||||
"name": "passthem",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def hack(raw: str) -> str:
|
||||
return base64.b64encode(raw[::-1].encode()).decode()
|
||||
|
||||
|
||||
hacked_contact = [{k: hack(v) for k, v in c.items()} for c in raw_contact]
|
||||
(Path(__file__).parent / "../src/lib/data").mkdir(exist_ok=True)
|
||||
_ = (Path(__file__).parent / "../src/lib/data/contact.json").write_text(
|
||||
json.dumps(hacked_contact)
|
||||
)
|
||||
Reference in New Issue
Block a user