diff --git a/README.md b/README.md index a67c4d1..95b04c7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # Mastowall 1.1 -Forked from [https://github.com/rstockm/mastowall](https://github.com/rstockm/mastowall) - Mastowall is a social wall application that displays posts from the [Mastodon](https://joinmastodon.org/) social network based on specified hashtags. It was written entirely by [ChatGPT4](https://openai.com/product/gpt-4), guided only by text prompts. -image +image + Try it live: [Mastowall for BDK23](https://tretkowski.de/mastowall/?hashtags=bdk23,netzbegruenung&server=https://gruene.social) @@ -38,8 +37,6 @@ JSON config file: - **Including Replies:** By default, replies are excluded from the wall. However, this behavior can be changed by setting includeReplies to true in the `config.json` file. -- **Configurable Overlay:** By default only the MastoWall is shown. For use with large displays eg during trade shows, conferences, booths, you can enable the Carousel with enlarged display of the 10 most recent posts. Just add `nbstand=1` to the argument in the URL. - ## Technology Stack Mastowall is built using the following technologies: @@ -66,7 +63,7 @@ Mastowall is built using the following technologies: ## Sharing via URL -Mastowall supports URL parameters to easily share specific hashtag configurations and the Mastodon server. Simply append the desired hashtags and the server URL to the URL following this format: `?hashtags=hashtag1,hashtag2,hashtag3&server=serverUrl&nbstand=0` +Mastowall supports URL parameters to easily share specific hashtag configurations and the Mastodon server. Simply append the desired hashtags and the server URL to the URL following this format: `?hashtags=hashtag1,hashtag2,hashtag3&server=serverUrl` Enjoy using Mastowall! diff --git a/config.json b/config.json index 0e72441..251cbb0 100644 --- a/config.json +++ b/config.json @@ -6,10 +6,7 @@ "refreshDuration": 30, "maxAge": 604800, "extraCards": [ - "", - "", - "", - "" + "" ], "includeReplies": true } diff --git a/index.html b/index.html index 5535d63..d144bab 100644 --- a/index.html +++ b/index.html @@ -38,11 +38,11 @@
- +
- +
diff --git a/screenshot.jpg b/screenshot.jpg deleted file mode 100644 index c4d8518..0000000 Binary files a/screenshot.jpg and /dev/null differ diff --git a/script.js b/script.js index 4031985..fa94ffb 100644 --- a/script.js +++ b/script.js @@ -55,8 +55,6 @@ let duration; let refresh; // extra cards text let extraCards; -// toggle Carousel -let withCarousel=false; // fetchConfig fetches the configuration from the config.json file const fetchConfig = async function() { @@ -79,10 +77,7 @@ const fetchConfig = async function() { duration = 10000; refresh = 30000; extraCards = [ - "", - "", - "", - "" + "
" ]; return "https://gruene.social"; } @@ -109,14 +104,6 @@ const updateTimesOnPage = function() { }); }; -// replace certain emojies in some text with images -const replaceEmojies = (text, emojis) => { - emojis.forEach(emoji => { - text = text.replaceAll(`:${emoji.shortcode}:`, ``); - }); - return text; -}; - // displayPost creates and displays a post const displayPost = function(post) { if (existingPosts.includes(post.id) || (!includeReplies && post.in_reply_to_id !== null)) return 0; @@ -128,14 +115,10 @@ const displayPost = function(post) {
-

${replaceEmojies(DOMPurify.sanitize(post.account.display_name), post.account.emojis)} @${DOMPurify.sanitize(post.account.acct)}

+

${DOMPurify.sanitize(post.account.display_name)} @${DOMPurify.sanitize(post.account.acct)}

- ${post.media_attachments[0] ? - (post.media_attachments[0].url.endsWith('.mp4') ? - `` : - ``) : - ''} -

${replaceEmojies(DOMPurify.sanitize(post.content), post.emojis)}

+ ${post.media_attachments[0] ? `` : ''} +

${DOMPurify.sanitize(post.content)}

${post.spoiler_text ? `

${DOMPurify.sanitize(post.spoiler_text)}

` : ''}

${timeAgo(secondsAgo(new Date(post.created_at)))}

@@ -150,7 +133,7 @@ const displayPost = function(post) { const processPosts = function(posts) { posts = posts.filter((post) => { - return secondsAgo(new Date(post.created_at)) < maxAge && post.content.indexOf("nitter.") === -1 && post.spoiler_text === "" + return secondsAgo(new Date(post.created_at)) < maxAge && post.content.indexOf("nitter.") === -1 }); return posts; @@ -202,22 +185,17 @@ const updateCarousel = function(slides, posts) { else { newHTML += `