diff --git a/public/index.html b/public/index.html index 6e606a4..107f8aa 100644 --- a/public/index.html +++ b/public/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/public/main.3912811afb38b9aa5c9ac95875c39d3b7df3012c509e83734e2ef6ad313d2a21.js b/public/main.7f2a4e7588eff96e37a6730867215635950a4dc8457db15814113c3c30337673.js similarity index 97% rename from public/main.3912811afb38b9aa5c9ac95875c39d3b7df3012c509e83734e2ef6ad313d2a21.js rename to public/main.7f2a4e7588eff96e37a6730867215635950a4dc8457db15814113c3c30337673.js index ee44641..450d2c9 100644 --- a/public/main.3912811afb38b9aa5c9ac95875c39d3b7df3012c509e83734e2ef6ad313d2a21.js +++ b/public/main.7f2a4e7588eff96e37a6730867215635950a4dc8457db15814113c3c30337673.js @@ -14,6 +14,16 @@ postsSorted = postsSorted.reverse().slice(0, numberTweets); 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) => { let authorId = tweet.author_id; let users = data.includes.users; @@ -22,11 +32,10 @@ return userName; }; 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 users = data.includes.users; 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; }; var tweet_text = (tweet) => tweet.text; diff --git a/public/music/index.html b/public/music/index.html index 51cc6fb..ea99ca9 100644 --- a/public/music/index.html +++ b/public/music/index.html @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/public/nounicorn.png b/public/nounicorn.png new file mode 100644 index 0000000..963e55a Binary files /dev/null and b/public/nounicorn.png differ