hhmx.de

Tim Kellogg

Tim Kellogg (@kellogh@hachyderm.io)

Föderation EN Do 25.01.2024 17:08:38

@leoncowle @andypiper good idea! i’m on a relatively big instance too

Leon Cowle

Leon Cowle (@leoncowle@hachyderm.io)

Föderation EN Do 25.01.2024 17:11:32

@kellogh @andypiper No, that doesn't work on your instance -- you have to use instances.social. I'm not sure, but I think instances.social is a specific service, not a Mastodon instance.

Andy Piper

Andy Piper (@andypiper@macaw.social)

Föderation EN Do 25.01.2024 17:12:06

@leoncowle @kellogh yeah I was going to suggest instances.social, and I also believe it is a specific thing.

Tim Kellogg

Tim Kellogg (@kellogh@hachyderm.io)

Föderation EN Do 25.01.2024 17:35:40

@andypiper @leoncowle omg i should've just let CoPilot guide me through it. This is all AI generated code...

def list_instances(search_term: str | None = None) -> list[dict[str, str]]:
    """
    List instances from the instances.social API.

    :param search_term: A search term to filter instances by.
    :return: A list of instances.
    """
    url = "https://instances.social/api/1.0/instances/list"
    params = {}
    if search_term:
        params["search"] = search_term

(Medien: 1)