GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
506 stars 55 forks source link

[Request]: URL handling for ShareToMastodon service #908

Open TriVoxel opened 2 months ago

TriVoxel commented 2 months ago

Describe the request

There is a web service for sharing articles to Mastodon. I discovered this while using the GTK app called "Newsflash". If I share to Mastodon, I can choose from a supported app, in this case only Firefox and GNOME Web showed up. It's really basic. The URL is formatted as such:

https://sharetomastodon.github.io/?title=<ARTICLE%20TITLE>&url=

It would be cool if Tuba could handle these sharing links so we can share from apps like Newsflash directly through Tuba! Here's a sample generated by Newsflash:

https://sharetomastodon.github.io/?title=New%20in%20Fedora%20Asahi%20Remix&url=https%3A%2F%2Fasahilinux%2Eorg%2F2024%2F01%2Ffedora%2Dasahi%2Dnew%2F

This will share the (currently) latest article from Asahi Linux. I think this project is a cool initiative to allow people to easily share things on Mastodon!

Screenshot from 2024-04-14 01-16-52

This pops up when you click "Share to Mastodon"

Implementation Details

GeopJr commented 2 months ago

I don't think this is possible unfortunately

Apps can register 'scheme handlers' but they can't filter based on host part for example. Browsers register http, https (among others). If Tuba registered that, it would be a suggestion for any link which is a bit of an overkill. Tuba already handles 2, tuba:// (used internally for callbacks) and web+ap which is the closest to what you request. It doesn't support composing at its current state (the spec is here https://fedilinks.org/spec/en/6-The-web-ap-URI) but it does support general activitypub links, like web+ap://floss.social/@Tuba should open tuba's profile in tuba

What I can do is either add support for composing like so tuba://compose?text=... with a browser extension that modifies 'sharetomastodon' links orrrr write a spec for that and propose it to other clients so we have a universal fedi://compose?text=...