let's do bsky now
This commit is contained in:
parent
b7efe26143
commit
12ecdce421
1 changed files with 9 additions and 9 deletions
|
@ -154,10 +154,10 @@ async function GetPost() {
|
|||
SetBoost();
|
||||
// Now time to see if there are any parents.
|
||||
if (post.hasOwnProperty("reply")) {
|
||||
Parentpost = await BlueskyReplyFunction("Parent", post.reply.parent, post.reply.parent.author);
|
||||
Parentpost = await BlueskyReplyFunction("0", post.reply.parent, post.reply.parent.author);
|
||||
// Now time to see if there are any grandparents.
|
||||
if (Parentpost.value.hasOwnProperty("reply")) {
|
||||
GrandParentpost = await BlueskyReplyFunction("GrandParent", Parentpost.value.reply.parent, post.reply.grandparentAuthor);
|
||||
GrandParentpost = await BlueskyReplyFunction("1", Parentpost.value.reply.parent, post.reply.grandparentAuthor);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -183,23 +183,23 @@ async function MastodonReplylFunction(Id, post) {
|
|||
return OtherPost;
|
||||
}
|
||||
|
||||
// TODO
|
||||
async function BlueskyReplyFunction(ClassName, post, OtherAuthor) {
|
||||
async function BlueskyReplyFunction(Id, post, OtherAuthor) {
|
||||
let OtherPost = await BlueskyAPI.GetRecord(post.uri.split("/")[2], post.uri.split("/")[3], post.uri.split("/")[4]);
|
||||
document.getElementsByClassName("Origin " + ClassName)[0].innerHTML = website;
|
||||
document.getElementsByClassName("Handle " + ClassName)[0].innerHTML = OtherAuthor.handle;
|
||||
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/>";
|
||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin", ShitHTML);
|
||||
Text = BlueskyAPI.ApplyFacets(OtherPost.value, OtherPost.value.text);
|
||||
Text = Text.replace(/\r?\n|\r/g, "<br/>");
|
||||
// Sensitive topic :3
|
||||
if (OtherPost.value.hasOwnProperty("labels") && OtherPost.value.labels.length != 0) {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = "LABELS APPLIED: ";
|
||||
for (let lab of OtherPost.value.labels.values) {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML += lab.val + " ";
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " ";
|
||||
}
|
||||
} else {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = Text;
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text;
|
||||
if (OtherPost.value.hasOwnProperty("embed")) {
|
||||
ApplyMedia(OtherPost.value.embed, document.getElementsByClassName("Images " + ClassName)[0], OtherAuthor.did);
|
||||
ApplyMedia(OtherPost.value.embed, document.getElementsByClassName("Images " + Id)[0], OtherAuthor.did);
|
||||
}
|
||||
}
|
||||
return OtherPost;
|
||||
|
|
Loading…
Add table
Reference in a new issue