From 1d9e8c373d348dcc42092a1b0a099cb02cfe59ed Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 19 Nov 2024 23:06:21 +0900 Subject: [PATCH 1/2] refs #2228 Support sharkey --- megalodon/src/detector.ts | 60 +++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/megalodon/src/detector.ts b/megalodon/src/detector.ts index b90c8292..7cc79262 100644 --- a/megalodon/src/detector.ts +++ b/megalodon/src/detector.ts @@ -59,20 +59,24 @@ export const detector = async (url: string): Promise<'mastodon' | 'pleroma' | 'f case NODEINFO_10: { const res = await axios.get(link.href, options) switch (res.data.software.name) { - case 'pleroma': - return 'pleroma' case 'akkoma': return 'pleroma' - case 'mastodon': - return 'mastodon' - case 'friendica': - return 'friendica' case 'firefish': return 'firefish' - case 'iceshrimp': - return 'firefish' + case 'friendica': + return 'friendica' case 'gotosocial': return 'gotosocial' + case 'hometown': + return 'mastodon' + case 'iceshrimp': + return 'firefish' + case 'mastodon': + return 'mastodon' + case 'pleroma': + return 'pleroma' + case 'sharkey': + return 'mastodon' default: if (res.data.metadata.upstream?.name && res.data.metadata.upstream.name.toLowerCase() === 'mastodon') { return 'mastodon' @@ -83,20 +87,24 @@ export const detector = async (url: string): Promise<'mastodon' | 'pleroma' | 'f case NODEINFO_20: { const res = await axios.get(link.href, options) switch (res.data.software.name) { - case 'pleroma': - return 'pleroma' case 'akkoma': return 'pleroma' - case 'mastodon': - return 'mastodon' - case 'friendica': - return 'friendica' case 'firefish': return 'firefish' - case 'iceshrimp': - return 'firefish' + case 'friendica': + return 'friendica' case 'gotosocial': return 'gotosocial' + case 'hometown': + return 'mastodon' + case 'iceshrimp': + return 'firefish' + case 'mastodon': + return 'mastodon' + case 'pleroma': + return 'pleroma' + case 'sharkey': + return 'mastodon' default: if (res.data.metadata.upstream?.name && res.data.metadata.upstream.name.toLowerCase() === 'mastodon') { return 'mastodon' @@ -107,20 +115,24 @@ export const detector = async (url: string): Promise<'mastodon' | 'pleroma' | 'f case NODEINFO_21: { const res = await axios.get(link.href, options) switch (res.data.software.name) { - case 'pleroma': - return 'pleroma' case 'akkoma': return 'pleroma' - case 'mastodon': - return 'mastodon' - case 'friendica': - return 'friendica' case 'firefish': return 'firefish' - case 'iceshrimp': - return 'firefish' + case 'friendica': + return 'friendica' case 'gotosocial': return 'gotosocial' + case 'hometown': + return 'mastodon' + case 'iceshrimp': + return 'firefish' + case 'mastodon': + return 'mastodon' + case 'pleroma': + return 'pleroma' + case 'sharkey': + return 'mastodon' default: if (res.data.metadata.upstream?.name && res.data.metadata.upstream.name.toLowerCase() === 'mastodon') { return 'mastodon' From 95d1aa3de32b8a09c88df64385c7fb3abd1578cb Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 19 Nov 2024 23:07:52 +0900 Subject: [PATCH 2/2] Add README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b1c1b6b2..13e3f539 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ The Rust version is [megalodon-rs](https://github.com/h3poteto/megalodon-rs). - [x] Firefish Firefish - [x] Gotosocial - [x] Akkoma (Unofficial) +- [x] Sharkey (Unofficial) +- [x] Hometown (Unofficial) +- [x] Iceshrimp (Unofficial) ## Features