This commit is contained in:
CatAClock 2025-07-16 19:32:52 -07:00
parent e7273174ae
commit c3fba0c0d8

View file

@ -156,7 +156,7 @@ async function GetPost() {
let NumberOfThreads = 0; let NumberOfThreads = 0;
let TemporaryPost = post; let TemporaryPost = post;
while (TemporaryPost.reply.parent != null) { while (TemporaryPost.reply.parent != null) {
TemporaryPost = await BlueskyReplyFunction("0", TemporaryPost.reply.parent, TemporaryPost.reply.parent.author).posts[0]; TemporaryPost = await BlueskyReplyFunction("0", TemporaryPost.reply.parent, TemporaryPost.reply.parent.author);
ThreadedPost.push(TemporaryPost); ThreadedPost.push(TemporaryPost);
// Any replies? Give them the thing :3 // Any replies? Give them the thing :3
for (let i of document.getElementsByClassName(NumberOfThreads)) { for (let i of document.getElementsByClassName(NumberOfThreads)) {
@ -190,23 +190,24 @@ async function MastodonReplylFunction(Id, post) {
return OtherPost; return OtherPost;
} }
async function BlueskyReplyFunction(Id, post, OtherAuthor) { async function BlueskyReplyFunction(Id, post) {
let OtherPost = await BlueskyAPI.GetPosts([post.uri]); let OtherPost = await BlueskyAPI.GetPosts([post.uri]);
OtherPost = OtherPost.posts[0];
console.log(OtherPost); console.log(OtherPost);
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + OtherAuthor.handle + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>"; let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + Id.author.handle + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin", ShitHTML); document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin", ShitHTML);
Text = BlueskyAPI.ApplyFacets(OtherPost.value, OtherPost.value.text); Text = BlueskyAPI.ApplyFacets(OtherPost.record, OtherPost.record.text);
Text = Text.replace(/\r?\n|\r/g, "<br/>"); Text = Text.replace(/\r?\n|\r/g, "<br/>");
// Sensitive topic :3 // Sensitive topic :3
if (OtherPost.value.hasOwnProperty("labels") && OtherPost.value.labels.length != 0) { if (OtherPost.record.hasOwnProperty("labels") && OtherPost.record.labels.length != 0) {
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = "LABELS APPLIED: "; document.getElementsByClassName("PostText " + Id)[0].innerHTML = "LABELS APPLIED: ";
for (let lab of OtherPost.value.labels.values) { for (let lab of OtherPost.value.labels.values) {
document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " "; document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " ";
} }
} else { } else {
document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text; document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text;
if (OtherPost.value.hasOwnProperty("embed")) { if (OtherPost.record.hasOwnProperty("embed")) {
ApplyMedia(OtherPost.value.embed, document.getElementsByClassName("Images " + Id)[0], OtherAuthor.did); ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], Id.author.did);
} }
} }
return OtherPost; return OtherPost;