Share to Fedi Button Builder
https://dillyofapickle.com/display/8aa28c03-6569-9296-f8e7-dfb207478076
Share to Fedi Button Builder
https://dillyofapickle.com/display/8aa28c03-6569-9296-f8e7-dfb207478076
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:
There is now an official Mastodon share button.
I like my implementation better.
This seems very...clunky.
Clunky to say the least, works with Mastodon and Mastodon alone, when it really isn't hard from the looks of it to support others... Well, one for all might be hard, but buttons for each service or compatible group.
Out of curiosity, how'd you get yours to work with both Mastodon and Friendica? If'n I plug my Friendica's instance into the either the official share button, or into that extension I mentioned, I get the same error, the extension solved this by having separate buttons for each.
@capitan With mine you do need to create separate buttons for Mastodon and Friendica, but the script handles either because the URL they send to the platform differs because of the page it calls and the names of the form fields it has to populate.
Mastodon's is like this:https://mastodon.server/share?text=Title Text%0A%0Ahttps%3A%2F%2Fexample.com%2Fsharedpage.htm
Friendica's is like this:https://friendica.server/compose?mode=minimal&title=Title Text&body=https%3A%2F%2Fexample.com%2Fsharedpage.htm
Mastodon's stand-alone posting page is just /share and it only has one form field named "text" so ?text=. Friendica's is /compose?mode=minimal and it has a "title" field and a "body" field, so &title= and &body=.
My script uses a Share2Fedi class, so you just create an instance of that class for the platform and define the targetpage, titlefield, and bodyfield for the link constructor in the share() method.
So if you know what the name of the stand-alone compose page is for a platform, and you know the names of title field (if it has one) and the body field of the composition form, it should theoretically be possible to make it work with any platform.
@capitan Mine uses /compose?mode=minimal because that mode minimal part means it only shows the compose form and none of the rest of the Friendica UI. Otherwise, in the small popup window it would show the mobile UI for the responsive themes, or a UI that doesn't fit for the older non-responsive ones.
Unfortunately once you submit your post there's no way to make it close the pop-up and load the full site in a new window, it will just refresh in that popup with the full site. 🙁. Of course that's not an issue if you set my script to open in a tab instead of a popup.
@capitan 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.
@randompenguin 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.