Skip to content

Instantly share code, notes, and snippets.

@joachimesque
joachimesque / script.py
Last active August 23, 2023 15:40
A simple command line utility that returns a JSON-formatted definitions list of the handle and url of a Fediverse address/handle/url
"""Returns a JSON-formatted definitions list of the handle and url of a Fediverse address."""
import json
import re
import click
import requests
API_ASK = ".well-known/webfinger?resource=acct:"
API_REL_PROFILE = "http://webfinger.net/rel/profile-page"