Tim Kellogg (@kellogh@hachyderm.io)
Föderation EN Do 25.01.2024 13:49:19
@andypiper hey is there a web service/site or library that lists known mastodon instances?
Leon Cowle (@leoncowle@hachyderm.io)
Föderation EN Do 25.01.2024 17:05:46
@kellogh @andypiper I've used this one before in some of my playing.
>>> import requests
>>> apikey=ā<redacted -- get one on instances.social>ā
>>> r = requests.get("https://instances.social/api/1.0/instances/list?count=0", headers={'Authorization':f'Bearer {apikey}'}).json()
>>> len(r['instances'])
17422
>>> r['instances'][250]['name']
's.ovalerio.net'
>>> r['instances'][250]['up']
True
>>> r['instances'][250]['dead']
False
(Full path that is possibly truncated above [by Mastodon] is: /api/1.0/instances/list?count=0]
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 (@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 (@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 (@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...
(Medien: 1)