Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Embed post in other locations #1159

Open
anantshri opened this issue Nov 27, 2022 · 10 comments
Open

[feature] Embed post in other locations #1159

anantshri opened this issue Nov 27, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@anantshri
Copy link
Contributor

Is your feature request related to a problem ?

Currently mastodon provides following features.

for example https://mastodon.social/@anantshri/103165388934116709

is also available in json @ https://mastodon.social/@anantshri/103165388934116709.json
and is also available as embedable format https://mastodon.social/@anantshri/103165388934116709/embed

This allows quick sharing of the post if someone wants outside of fediverse also.

Describe the solution you'd like.

Enable any of the two options in gotosocial interface

Describe alternatives you've considered.

NONE

Additional context.

No response

@anantshri anantshri added the enhancement New feature or request label Nov 27, 2022
@ppetermann
Copy link

out of curiosity, from your perspective, what exactly are the requirements to consider a post format embeddable?
a regular post is opengraph (https://ogp.me/) enabled, which means that a lot of places can already embed it by rendering it in their own preferred looks.
(for example, posts will already render automatically in tools like discord)

@anantshri
Copy link
Contributor Author

Ah @ppetermann thanks for pointing to ogp graph. Didnt realized about that. That is one part of the equation.

Another angle is a lot of folks now would want things like https://github.com/kbravh/obsidian-tweet-to-markdown kind of plugins.
These plugins facilitate keeping a local copy of something that people find interesting. with mastodon .json format it gets easy to pipe things across to another process etc.

Does that makes sense?

@ppetermann
Copy link

wouldnt the regular api (https://mastodon.social/api/v1/statuses/103165388934116709) be sufficient?

@ppetermann
Copy link

never mind, seems gotosocial currently requires the token even for public posts (but maybe changing that would be a solve?)

@anantshri
Copy link
Contributor Author

Ya if we have an endpoint which gives json without requiring auth that would solve the problem.

@tsmethurst
Copy link
Contributor

tsmethurst commented Nov 30, 2022

if we have an endpoint which gives json without requiring auth

that's unlikely to be something we'll implement :P

[edit] Just to expand on this, we do have a flag to expose the public timeline: #1039

But exposing individual posts via the API without auth is a different matter..

@ppetermann
Copy link

@tsmethurst public posts are available as html without auth already the only difference would be how easy it is to parse?

@tsmethurst
Copy link
Contributor

the only difference would be how easy it is to parse

That's not the only difference. It also makes posts easier to scrape, and additional information is exposed in the json that isn't exposed via the web

@deuill
Copy link

deuill commented Jul 7, 2023

Not certain if anything's changed in the intervening time, but just throwing in one additional data-point in favour of limited unauthenticated access for /api/v1/statuses/:id at least -- I've been looking to add in-line comments to my blog for a while, and found a number of interesting (and fairly minimal) solutions to this for Mastodon, e.g.:

Comments via the Fediverse are ideal, as they solve issues with discoverability (arguably both ways) and authentication; however, the solutions above are not feasible with Gotosocial, as access to /api/v1/statuses/:id/context (which is the API endpoint most of these seem to use) is authenticated.

I suppose you're still averse to allowing for (configurable) access to public statuses by ID for unauthenticated actors due to aforementioned additional data being returned, but AFAICT any reasonable scraping these endpoints would require access to the timeline (in order to get valid IDs), and it might also be possible to withhold certain sensitive fields from responses for unauthenticated requests.

@nishtahir
Copy link

out of curiosity, from your perspective, what exactly are the requirements to consider a post format embeddable? a regular post is opengraph (https://ogp.me/) enabled, which means that a lot of places can already embed it by rendering it in their own preferred looks. (for example, posts will already render automatically in tools like discord)

@ppetermann Just adding my own data point, but I think the key is having a single post's page formatted in such a way that it fits seamlessly into an iframe. Given that GTS already has a front that can render posts, providing a /embed and optionally a supporting initialization script would be incredibly helpful.

For example, Mastodon's embed feature on a post generates this embed HTML

<iframe src="https://mastodon.social/@rust_discussions/111876235097220830/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script src="https://mastodon.social/embed.js" async="async"></script>

when added to a page, renders as

rust weekly mastodon embed

The main audience for this would be webpages and blogs that want to render single posts. https://blog.medium.com/now-you-can-embed-mastodon-posts-in-medium-stories-99b11d0baa7f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants