Feat: Friendica support (#11)
* feat: support PMs * feat: friendica admins * fix * supported softwarepull/13/head
parent
fdb872f7cf
commit
cf488eb583
|
@ -2,4 +2,5 @@ FEDISEER_VERSION = "0.5.0"
|
|||
SUPPORTED_SOFTWARE = [
|
||||
"lemmy",
|
||||
"mastodon",
|
||||
"friendica",
|
||||
]
|
|
@ -23,6 +23,7 @@ def get_admin_for_software(software: str, domain: str):
|
|||
software_map = {
|
||||
"lemmy": get_lemmy_admins,
|
||||
"mastodon": get_mastodon_admins,
|
||||
"friendica": get_mastodon_admins,
|
||||
}
|
||||
if software not in software_map:
|
||||
return []
|
||||
|
@ -41,7 +42,7 @@ def get_nodeinfo(domain):
|
|||
}
|
||||
wellknown = requests.get(f"https://{domain}/.well-known/nodeinfo", headers=headers, timeout=3).json()
|
||||
headers["Sec-Fetch-Site"] = "cross-site"
|
||||
nodeinfo = requests.get(wellknown['links'][0]['href'], headers=headers, timeout=3).json()
|
||||
nodeinfo = requests.get(wellknown['links'][-1]['href'], headers=headers, timeout=3).json()
|
||||
return nodeinfo
|
||||
except Exception as err:
|
||||
return None
|
|
@ -38,6 +38,7 @@ class ActivityPubPM:
|
|||
software_map = {
|
||||
"lemmy": self.send_lemmy_pm,
|
||||
"mastodon": self.send_mastodon_pm,
|
||||
"friendica": self.send_mastodon_pm,
|
||||
"fediseer": self.send_fediseer_pm,
|
||||
}
|
||||
return software_map[software](message, username, domain)
|
||||
|
|
Loading…
Reference in New Issue