Does anybody know of a Mastodon API for websites that lets me add a "Toot" button? Something like this from Twitter: dev.twitter.com/web/tweet-butt

@mhall119 Nothing ready to use. But you can call mastodon.cloud/share?text=mess. To make it generic you need to have two input fields to add the Mastodon instance and the message someone want to send. I use it for share buttons on my blog, you can see it here if you scroll down: schiessle.org/articles/2017/11 Code is here: gitlab.com/BeS/hugo-sustain-ng

@bjoern Thanks Bjorn! Having to enter a mastodon instance isn't a great experience though, I couldn't actually remember which one I use :(

@mhall119
You could also have a drop down with the most common used instances. But that's the downside of decentralization, there is no central server for everyone. If you find a better solution I'm happy to hear about it but I fear there is none. :(

@bjoern But isn't the point of decentralization that you don't *need* a centralized server?

Couldn't I, in theory, tell mastodon.rocks that I want to post as @mhall119 and it would know that this account is registered with mastodon.cloud and either redirect me or use APIs to authenticate me?

@mhall119
How do you want to make sure that mastodon.rocks knows all instances and all users out there? Everybody can set up a instance at any time and/or register a user on any instance.

@mhall119 Mastodon has a custom url scheme that you can use. It's something like web+mastodon

@mhall119 It seems impossible because you, the Web page author, do not know the instance used by the Web page reader.

(And I think it is a bad idea, anyway. Sharing should be controlled by the user, for instance with addons.mozilla.org/fr/firefox/ )

@bortzmeyer Sharing would be controlled by the user, just allowing them to initiate the action and pre-populate text from the webpage

@mhall119 Actual "sharing" buttons do not leave control to the user. They are active Javascript and tell Facebook even before you click.

Sign in to participate in the conversation
mastodon.cloud

Everyone is welcome as long as you follow our code of conduct! Thank you. Mastodon.cloud is maintained by Sujitech, LLC.