Skip to content

bolhaverso/mastopoet

 
 

Repository files navigation

Mastopoet Banner, AI generated, by @rolle@mementomori.social

Mastopoet

The post screenshot tool for Mastodon. Developed by @[email protected]

What?

Mastopoet is an open source screenshot tool for Mastodon, inspired by poet.so. It allows you to create ✨ stunning ✨ screenshots of your posts, with ability to remove stuff you don't want (bookmark button, publicity symbol, settings button...). And with a theme that's not dependent on the theme of the instance!

Demo

URL Query feature

Add ?url= to the end of the Mastopoet URL to generate links that immediately open the post on Mastopoet.

Themes available

  • Bird UI (Dark, Light)
  • Mastodon (Dark, Dark + light interaction labels, Light)

Images/profile pictures not working?

This is due to CORS. It's a security feature of browsers, when assets (like profile pictures) are accessed from other websites. I cannot do anything about it, as the whole process is done client-side.

The images are (almost) always fetched from the instance that your link is from. So, if your link is https://instance1.social/@[email protected]/0000000000, the data is fetched from instance1.social, even if the post is posted originally on instance2.social.

If you want to get Mastopoet working, contact that instances admin and ask them to allow anonymous CORS (crossOrigin: "anonymous") requests for their Mastodon media server.

OR: You can try using an other instance and find the post. Here's a few working instances:

For admins this means they need to add the Access-Control-Allow-Origin header to the server providing your users with images hosted on Mastodon. You can set it to '*', or allow just Mastopoet with 'https://mastopoet.raikas.dev'. There's more technical information on MDN Docs.

Deploying

You can use Docker (instructions below), or simply host the website on a static platform. Mastopoet is a React SPA, compiled by Vite, allowing it to be deployed to pretty much any hosting service. My recommendations are Cloudflare Pages, Netlify and Github Pages.

First, install dependencies with npm install and then build the app with npm run build. Simple as that! The application is in the dist directory.

Ko-fi advert

By default, the default post shows a link to my Ko-fi profile. If you want to disable it, you can customize the defaultPost in src/config.ts, or set environment value VITE_HIDE_DEVELOPER_KOFI_AD to false. I appreciate if you decide to keep it.

Building with docker

You can use docker for deploying a production ready instance of Mastopoet.

You can build with:

docker build -t mastopoet .

It will build the application and deploy in an nginx instance, when the image is built you can run using:

docker run -d -p 80:80 mastopoet

For more options, see nginx container options at dockerhub

TODO

  • Customizable gradient
  • Bird UI light theme port
  • Mastodon theme port
  • Customizable date format
  • A logo (to website embed)
  • Read toot URL from query
  • Default toot with information
  • Fix multi image image galleries
  • Support for non-Mastodon links
  • Alt text generator
  • PDF export with link (idea)
  • Detect CORS failed images and show user info box
  • If toot div is not an full integer, weird bars show in image.
  • Add support for Misskey/Firefish (src/instance/Misskey.ts)

Credits

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 62.4%
  • SCSS 34.1%
  • HTML 2.1%
  • Other 1.4%