Share to Fedi Button Builder
Someone asked me if there was a share button for Friendica. I didn't really surprise me that I couldn't find one. I'd written one a while back for Mastodon, but it wouldn't connect to Friendica. I figured out why and rewrote my script so it can be extended to theoretically share to any Fediverse platform.
This is all done with JS on the client side. There's no proxy or connector service. I also set it up so you can load a minified script from a CDN.
Right now it only supports share buttons for Mastodon, any ActivityPub platform that uses the same post composer setup as Mastodon, and Friendica.
In fact, I shared this post you're reading right now using a button from the link below where you can configure buttons and grab the code you'd need to drop into your website.
like this
reshared this
Random Penguin
in reply to Random Penguin • • •Once you enter your server URL and hit the "Share!" button it will try to go to the compose window for your account on that server, under the assumption you're already logged in there in the same browser. Then it will open the bare-bones Compose window, with the page title in the title field and the link in post body. Then you can write whatever else you want, add images, etc. before you post:
One downside is the "Submit" button won't close the pop-up window. It will refresh and show you the submitted post in the full web UI, which will likely be the mobile view in that small pop-up window. If you, as a website owner, don't want that experience for your visitors, you can change the script settings to open the share dialog in a new tab instead of a pop-up window. But I set it to default to a pop-up since that's how ALL the other social media platforms do it when you hit a share button.
Roland Häder🇩🇪 likes this.
Friendica Support reshared this.
VegOS
in reply to Random Penguin • • •Friendica Support reshared this.
Random Penguin
in reply to VegOS • • •Marcus likes this.
Friendica Support reshared this.
Kāpitan
in reply to Random Penguin • •Gryficowa likes this.
Friendica Support reshared this.
Random Penguin
in reply to Kāpitan • • •I was specifically interested in share buttons you can put on a personal website so visitors to the site can easily share your content to their fedi accounts, not for me to share content to my own fedi accounts.
And I wanted it to look and work as closely as possible to how pressing a Facebook or X/Twitter share button works. Once someone has visited your website and told it to remember their instance they don't have to enter it again, so later when they hit the share button on your site it's as frictionless as sharing to any of the centralized social sites.
like this
Marcus and Roland Häder🇩🇪 like this.
Friendica Support reshared this.
Kāpitan
in reply to Random Penguin • •@Random Penguin Nods, "This sounds like what Fedishare (abandonware sadly) does, but they do it via extension rather than being on the web page to get around the instance issue. In the extension settings, you set what instance your on for whichever Fedi services you use, limited to one instance per service (programmer's choice?), and if you're on a web page you want to share, you simply click on the Fedishare button in your toolbar followed by clicking on the service, and you get a pre-filled new post ready for final touches and posting or scheduling.
Not quite the same as having a button on a web page mind you, but it works pretty well, I've been using it for a few years across my various accounts here.
codeberg.org/Jeremmy/fedishare
Roland Häder🇩🇪 likes this.
Friendica Support reshared this.