This commit is contained in:
Ral 2021-12-26 05:50:45 +01:00
parent 08a51b5758
commit a7d90d73cf
4 changed files with 13 additions and 4 deletions

View File

@ -13,6 +13,6 @@
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script> <script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script> <script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script> <script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
<script src=https://infobeamer.montage2.de/main.3912811afb38b9aa5c9ac95875c39d3b7df3012c509e83734e2ef6ad313d2a21.js integrity="sha256-ORKBGvs4uapcmslYdcOdO33zASxQnoNzTi72rTE9KiE=" type=module></script> <script src=https://infobeamer.montage2.de/main.7f2a4e7588eff96e37a6730867215635950a4dc8457db15814113c3c30337673.js integrity="sha256-fypOdYjv+W43pnMIZyFWNZUKTchFfbFYFBE8PDAzdnM=" type=module></script>
</body> </body>
</html> </html>

View File

@ -14,6 +14,16 @@
postsSorted = postsSorted.reverse().slice(0, numberTweets); postsSorted = postsSorted.reverse().slice(0, numberTweets);
return postsSorted; return postsSorted;
}; };
var default_profile_image = () => "./nounicorn.png";
var replace_default_image = (url) => {
let newUrl;
if (url === "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png" || url === "https://chaos.social/avatars/original/missing.png") {
newUrl = default_profile_image();
} else {
newUrl = url;
}
return newUrl;
};
var tweet_author = (data, tweet) => { var tweet_author = (data, tweet) => {
let authorId = tweet.author_id; let authorId = tweet.author_id;
let users = data.includes.users; let users = data.includes.users;
@ -22,11 +32,10 @@
return userName; return userName;
}; };
var tweet_profile_image = (data, tweet) => { var tweet_profile_image = (data, tweet) => {
const defaultProfileImageUrl = "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png";
let authorId = tweet.author_id; let authorId = tweet.author_id;
let users = data.includes.users; let users = data.includes.users;
let author = users.find((item) => item.id === authorId); let author = users.find((item) => item.id === authorId);
let profileImageUrl = author !== void 0 ? author.profile_image_url : defaultProfileImageUrl; let profileImageUrl = replace_default_image(author.profile_image_url);
return profileImageUrl; return profileImageUrl;
}; };
var tweet_text = (tweet) => tweet.text; var tweet_text = (tweet) => tweet.text;

View File

@ -13,6 +13,6 @@
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script> <script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script> <script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script> <script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
<script src=https://infobeamer.montage2.de/main.3912811afb38b9aa5c9ac95875c39d3b7df3012c509e83734e2ef6ad313d2a21.js integrity="sha256-ORKBGvs4uapcmslYdcOdO33zASxQnoNzTi72rTE9KiE=" type=module></script> <script src=https://infobeamer.montage2.de/main.7f2a4e7588eff96e37a6730867215635950a4dc8457db15814113c3c30337673.js integrity="sha256-fypOdYjv+W43pnMIZyFWNZUKTchFfbFYFBE8PDAzdnM=" type=module></script>
</body> </body>
</html> </html>

BIN
public/nounicorn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB