djangocon / 2023.djangocon.us

🫐 The DjangoCon US 2023 conference website
https://2023.djangocon.us
Other
16 stars 49 forks source link

Mastodon handles in speaker profile #134

Closed drewbrew closed 1 year ago

drewbrew commented 1 year ago

In 2022, we had speakers upload their mastodon handles in the form https://example.social/@username.

In 2023, about half the speakers who added their mastodon handle did it in the form @user@example.social.

We need a way to programmatically convert the latter to the former, either at import time or in the template code

drewbrew commented 1 year ago

CC @mtrythall and @jefftriplett for ideas

jefftriplett commented 1 year ago

If you are looking for a tech solution, that should be possible to do here: https://github.com/djangocon/2023.djangocon.us/blob/main/bin/process.py#L113-L122

My buddy ChatGPT recommends:

def convert_handle(handle):
    if not handle.startswith("@"):
        return handle

    username, domain = handle[1:].split("@")
    return f"https://{domain}/@{username}"

...Which I think would work. Should we try it on https://github.com/djangocon/2023.djangocon.us/pull/135?

drewbrew commented 1 year ago

Looks right to me.