that should do it

This commit is contained in:
CatAClock 2025-07-16 21:01:44 -07:00
parent 3f27873fcf
commit 5455a74573

View file

@ -183,9 +183,9 @@ async function GetPost() {
NumberOfThreads += 1;
}
// Replies, anyone?
let Context = await BlueskyAPI.GetPostThread(post.record.uri);
let Context = await BlueskyAPI.GetPostThread(post.post.uri);
console.log(Context);
for (let i of Context.descendants) {
for (let i of Context.thread.replies) {
TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i);
ThreadedPost.push(TemporaryPost);
// Any posts? Give them the thing :3
@ -264,29 +264,23 @@ async function BlueskyThreadFunction(Id, post) {
}
async function BlueskyReplyFunction(Id, post) {
let OtherPost = await BlueskyAPI.GetPosts([post.uri]);
OtherPost = OtherPost.posts[0];
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + OtherPost.author.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 + "\"> " + post.post.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("beforeend", ShitHTML);
Text = BlueskyAPI.ApplyFacets(OtherPost.record, OtherPost.record.text);
Text = BlueskyAPI.ApplyFacets(post.post.record, post.post.record.text);
Text = Text.replace(/\r?\n|\r/g, "<br/>");
// Sensitive topic :3
if (OtherPost.record.hasOwnProperty("labels") && OtherPost.record.labels.length != 0) {
if (post.post.record.hasOwnProperty("labels") && post.post.record.labels.length != 0) {
document.getElementsByClassName("PostText " + Id)[0].innerHTML = "LABELS APPLIED: ";
for (let lab of OtherPost.value.labels.values) {
for (let lab of post.post.value.labels.values) {
document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " ";
}
} else {
document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text;
if (OtherPost.record.hasOwnProperty("embed")) {
ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], OtherPost.author.did);
if (post.post.record.hasOwnProperty("embed")) {
ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images " + Id)[0], post.post.author.did);
}
}
// Get the reply and make it make sense.
if (OtherPost.record.hasOwnProperty("reply")) {
OtherPost.reply = OtherPost.record.reply;
}
return OtherPost;
return post;
}
// Applyers. Essentially applies a thing to an operation.