fedimbed: try 2
This commit is contained in:
parent
c9b248e23d
commit
705f9062e0
1 changed files with 9 additions and 2 deletions
|
@ -127,8 +127,15 @@ async function processUrl(msg, url) {
|
||||||
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
||||||
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
||||||
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
||||||
let noteId = url.split("/notes/")[0]
|
let noteId = url.split("/notes/")[0];
|
||||||
noteId = noteId.split(noteId.indexOf("/") > -1 ? "/" : "?")[0];
|
if (noteId.indexOf("/") > -1) {
|
||||||
|
noteId = noteId.split("/")[0];
|
||||||
|
} else if (noteId.indexOf("?") > -1) {
|
||||||
|
noteId = noteId.split("?")[0];
|
||||||
|
} else if (noteId.indexOf("#") > -1) {
|
||||||
|
noteId = noteId.split("#")[0];
|
||||||
|
}
|
||||||
|
logger.debug("fedimbed", "Misskey post ID: " + noteId);
|
||||||
redirUrl = urlObj.origin + "/api/notes/show/";
|
redirUrl = urlObj.origin + "/api/notes/show/";
|
||||||
options.method = "POST";
|
options.method = "POST";
|
||||||
options.body = JSON.stringify({noteId});
|
options.body = JSON.stringify({noteId});
|
||||||
|
|
Loading…
Reference in a new issue