that should do it
This commit is contained in:
parent
3f27873fcf
commit
5455a74573
1 changed files with 9 additions and 15 deletions
|
@ -183,9 +183,9 @@ async function GetPost() {
|
||||||
NumberOfThreads += 1;
|
NumberOfThreads += 1;
|
||||||
}
|
}
|
||||||
// Replies, anyone?
|
// Replies, anyone?
|
||||||
let Context = await BlueskyAPI.GetPostThread(post.record.uri);
|
let Context = await BlueskyAPI.GetPostThread(post.post.uri);
|
||||||
console.log(Context);
|
console.log(Context);
|
||||||
for (let i of Context.descendants) {
|
for (let i of Context.thread.replies) {
|
||||||
TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i);
|
TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i);
|
||||||
ThreadedPost.push(TemporaryPost);
|
ThreadedPost.push(TemporaryPost);
|
||||||
// Any posts? Give them the thing :3
|
// Any posts? Give them the thing :3
|
||||||
|
@ -264,29 +264,23 @@ async function BlueskyThreadFunction(Id, post) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function BlueskyReplyFunction(Id, post) {
|
async function BlueskyReplyFunction(Id, post) {
|
||||||
let OtherPost = await BlueskyAPI.GetPosts([post.uri]);
|
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/>";
|
||||||
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/>";
|
|
||||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend", ShitHTML);
|
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/>");
|
Text = Text.replace(/\r?\n|\r/g, "<br/>");
|
||||||
// Sensitive topic :3
|
// 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: ";
|
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 + " ";
|
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.record.hasOwnProperty("embed")) {
|
if (post.post.record.hasOwnProperty("embed")) {
|
||||||
ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], OtherPost.author.did);
|
ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images " + Id)[0], post.post.author.did);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Get the reply and make it make sense.
|
return post;
|
||||||
if (OtherPost.record.hasOwnProperty("reply")) {
|
|
||||||
OtherPost.reply = OtherPost.record.reply;
|
|
||||||
}
|
|
||||||
return OtherPost;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Applyers. Essentially applies a thing to an operation.
|
// Applyers. Essentially applies a thing to an operation.
|
||||||
|
|
Loading…
Add table
Reference in a new issue