From 4c13cb96e970d16e35d46739804e0345f1f05d8a Mon Sep 17 00:00:00 2001 From: Ral Date: Mon, 27 Dec 2021 18:46:10 +0100 Subject: [PATCH] Plainfy tweets --- public/hashtag/index.html | 2 +- public/index.html | 2 +- ...2075141dd003a18a08823cf1808a2cb994bbe8.js} | 20 +++++++++---------- public/music-and-posts/index.html | 2 +- public/music/index.html | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename public/{main.04922805f53ba12600a59910ea3ca3543e058dbb609423a2e295f4c37a681418.js => main.1f4bd9e53091d1e9aa0a2e38b82075141dd003a18a08823cf1808a2cb994bbe8.js} (99%) diff --git a/public/hashtag/index.html b/public/hashtag/index.html index 3a452c9..1be1ef8 100644 --- a/public/hashtag/index.html +++ b/public/hashtag/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/public/index.html b/public/index.html index ab77797..877f720 100644 --- a/public/index.html +++ b/public/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/public/main.04922805f53ba12600a59910ea3ca3543e058dbb609423a2e295f4c37a681418.js b/public/main.1f4bd9e53091d1e9aa0a2e38b82075141dd003a18a08823cf1808a2cb994bbe8.js similarity index 99% rename from public/main.04922805f53ba12600a59910ea3ca3543e058dbb609423a2e295f4c37a681418.js rename to public/main.1f4bd9e53091d1e9aa0a2e38b82075141dd003a18a08823cf1808a2cb994bbe8.js index fc26bb4..47a1899 100644 --- a/public/main.04922805f53ba12600a59910ea3ca3543e058dbb609423a2e295f4c37a681418.js +++ b/public/main.1f4bd9e53091d1e9aa0a2e38b82075141dd003a18a08823cf1808a2cb994bbe8.js @@ -35,6 +35,15 @@ }); return text; }; + var html_plainify = (html2) => { + let span = document.createElement("span"); + span.innerHTML = html2; + let children = span.querySelectorAll("*"); + children.forEach((child) => { + child.textContent += " "; + }); + return span.textContent.toString().replace(/ +/g, " "); + }; var tweet_author = (data, tweet) => { let authorId = tweet.author_id; let users = data.includes.users; @@ -57,7 +66,7 @@ return { author: tweet_author(d, t), image: tweet_profile_image(d, t), - text: censorship(tweet_text(t)), + text: censorship(html_plainify(tweet_text(t))), time: tweet_time(t), source: "twitter" }; @@ -68,15 +77,6 @@ var toot_profile_image = (toot) => replace_default_image_url(toot.account.avatar_static); var toot_text = (toot) => toot.content; var toot_time = (toot) => toot.created_at; - var html_plainify = (html2) => { - let span = document.createElement("span"); - span.innerHTML = html2; - let children = span.querySelectorAll("*"); - children.forEach((child) => { - child.textContent += " "; - }); - return span.textContent.toString().replace(/ +/g, " "); - }; var mastodon_filter = (idata) => { let toots; idata.forEach((d) => { diff --git a/public/music-and-posts/index.html b/public/music-and-posts/index.html index d2f7fd5..17e840d 100644 --- a/public/music-and-posts/index.html +++ b/public/music-and-posts/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/public/music/index.html b/public/music/index.html index 825a7e2..5d66831 100644 --- a/public/music/index.html +++ b/public/music/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file