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 = [
|
SUPPORTED_SOFTWARE = [
|
||||||
"lemmy",
|
"lemmy",
|
||||||
"mastodon",
|
"mastodon",
|
||||||
|
"friendica",
|
||||||
]
|
]
|
|
@ -23,6 +23,7 @@ def get_admin_for_software(software: str, domain: str):
|
||||||
software_map = {
|
software_map = {
|
||||||
"lemmy": get_lemmy_admins,
|
"lemmy": get_lemmy_admins,
|
||||||
"mastodon": get_mastodon_admins,
|
"mastodon": get_mastodon_admins,
|
||||||
|
"friendica": get_mastodon_admins,
|
||||||
}
|
}
|
||||||
if software not in software_map:
|
if software not in software_map:
|
||||||
return []
|
return []
|
||||||
|
@ -41,7 +42,7 @@ def get_nodeinfo(domain):
|
||||||
}
|
}
|
||||||
wellknown = requests.get(f"https://{domain}/.well-known/nodeinfo", headers=headers, timeout=3).json()
|
wellknown = requests.get(f"https://{domain}/.well-known/nodeinfo", headers=headers, timeout=3).json()
|
||||||
headers["Sec-Fetch-Site"] = "cross-site"
|
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
|
return nodeinfo
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
return None
|
return None
|
|
@ -38,6 +38,7 @@ class ActivityPubPM:
|
||||||
software_map = {
|
software_map = {
|
||||||
"lemmy": self.send_lemmy_pm,
|
"lemmy": self.send_lemmy_pm,
|
||||||
"mastodon": self.send_mastodon_pm,
|
"mastodon": self.send_mastodon_pm,
|
||||||
|
"friendica": self.send_mastodon_pm,
|
||||||
"fediseer": self.send_fediseer_pm,
|
"fediseer": self.send_fediseer_pm,
|
||||||
}
|
}
|
||||||
return software_map[software](message, username, domain)
|
return software_map[software](message, username, domain)
|
||||||
|
|
Loading…
Reference in New Issue