stefan, (edited )
@stefan@stefanbohacek.online avatar

UPDATE: The plugin is now live: https://wordpress.org/plugins/fediverse-embeds/

A very much work-in-progress WordPress plugin for embedding fediverse posts. Any help and feedback will be very appreciated!

https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin

stefan,
@stefan@stefanbohacek.online avatar
sustainrelease,
@sustainrelease@mastodon.social avatar

@stefan Great tool. Very useful.

stefan,
@stefan@stefanbohacek.online avatar

@sustainrelease Thank you!

I'm hoping it'll be accepted in the WordPress plugin directory within the next week or two, that'll make it easier to install.

atarifrosch,

@stefan Installed on ClassicPress. If anything goes wrong, I'll let you know. 🙂

ekis,
@ekis@mastodon.social avatar

@stefan I don't often programing PHP unless I'm explicitly helping someone often with wordpress.

I could defnitely extract watever messages you want and auto-post them. Email me at ekis@shehackedyou.com

I can do it on stream soon, and have it ready for you shortly. It really wouldn't take me long.

Speeding up the process is being specific about functional requirements (what has to exist for basic functionality) to be accurate as possible (it never is though dont worry)

stefan,
@stefan@stefanbohacek.online avatar

@ekis Thank you, really appreciate the offer! I'm moving today, so I'll follow up over the next day or two.

sl007,
@sl007@digitalcourage.social avatar
Sascha,
@Sascha@bonn.social avatar

@stefan @fediversereport Guck mal @Johannes, bestimmt wartest du genau das Plugin.

cogdog,

@stefan Color me interested-- this is rendering embed codes? I am more interested for autoembed from a post URL

I made a crude one that's been working on my WP blog

https://cogdogblog.com/2022/12/toot-in-em-bed/

stefan,
@stefan@stefanbohacek.online avatar

@cogdog Good question!

Basically, the plugin "replaces" the iframe embed code with a Twitter-style block quote, which allows me to reuse code from a similar plugin I wrote for Twitter, which turns the block quote into what you see on the front end.

https://github.com/fourtonfish/tweet-embeds-wordpress-plugin

Thank you for sharing your article, I'll check it out!

cogdog,

@stefan Either way works I guess. I like embedding from the URL.

Challenge was identifying a fediverse post from URL, my weak regex got me looking for a pattern if a domain/@username/IDstringofdigits

Been working okay. I'm thinking/hoping WordPress will add support

stefan,
@stefan@stefanbohacek.online avatar

@cogdog Yeah, that would be great. And yes, there is quite a few challenges getting this to work.

FYI, if this is useful, but one approach could be parsing the URL to get the domain, and then checking the /.well-known/nodeinfo endpoint.

https://stefanbohacek.com/blog/making-fediverse-apps-for-everyone/#about-server

I am using this for a few projects, including this plugin.

stefan,
@stefan@stefanbohacek.online avatar

@cogdog Also, not all platforms support iframes, and I'm still working out the oEmbed support on those that have it.

pfefferle,
@pfefferle@mastodon.social avatar

@stefan isn‘t that already working fine using oEmbed?

stefan,
@stefan@stefanbohacek.online avatar

@pfefferle Good question! My main reason for creating this plugin was a site I maintain for creative bots at https://botwiki.org.

The goal is to create an archive of creative social media bots, and as part of this I want to include some example output, usually in the form of a post.

Now, when a post included via an iframe is deleted, it will also disappear from your site. Similarly, if you include your own posts, and the instance you use goes away, you lose all your own embedded posts.

stefan,
@stefan@stefanbohacek.online avatar

@pfefferle There are also other issues with performance, for example, if the server you're loading the post from is overloaded, or goes down, it will affect your site.

Twitter solves this by including the original post as a quote, which, if the tweet still exists, gets then formatted to look like a proper tweet.

I am still working out how to correctly handle deleted posts, see https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin/issues/1

stefan,
@stefan@stefanbohacek.online avatar

@pfefferle The bottom line is, I want to be able to quote a post and make it part of my site, but make it accessible, as opposed to taking a screenshot.

stefan,
@stefan@stefanbohacek.online avatar

@pfefferle And just to clarify, at least in Mastodon's case, the oEmbed code just returns an iframe, which is the default code you get when you embed a post.

cybeardjm,
@cybeardjm@masto.ai avatar

@pfefferle I did a few tests while discussing the topic with @stefan, and if it works with Mastodon today (but only using the specific function to get the iframe + script), not by copy/pasting the "naked" URL, it doesn't work with other platforms, such as Calckey etc. [didn't test all of them].

stefan,
@stefan@stefanbohacek.online avatar

@cybeardjm @pfefferle Yes, I believe the post came out unstyled, so that doesn't work out of the box.

cassidy,
@cassidy@blaede.family avatar

@stefan I always wonder for these sorts of embeds: if possible, should they just be handled on the host site instead of embedding from a remote URL? Like, reproduce the content locally, and then link out to the original post. That way a super popular website/article doesn’t DDoS the origin, and you can also keep the OP accountable if they later delete the post (e.g. when dealing with politicians or other public figures).

Idk how people feel about it, but I always did that for Twitter “embeds.”

stefan,
@stefan@stefanbohacek.online avatar

@cassidy Yes, absolutely! Or the other way around, pulling in content from an overloaded server and slowing down your site.

But I wonder if the reason why embeds are done with iframes is mainly to have them removed from everywhere once they're deleted.

So it's really important to get this right. https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin/issues/1

Andres,
@Andres@mastodon.hardcoredevs.com avatar

@stefan
I think @evan can be interested.

evan,
@evan@cosocial.ca avatar
Andres,
@Andres@mastodon.hardcoredevs.com avatar

@evan @stefan @pfefferle
Sorry about the missing context.
I shared this with you because of the poll for embedding :mastodon: posts.

evan,
@evan@cosocial.ca avatar

@Andres @stefan yes, and I shared with @pfefferle because he works on AP at Automattic and may find the work interesting

Andres,
@Andres@mastodon.hardcoredevs.com avatar

@evan @stefan @pfefferle
Oh I get it! I thought it was a question, my bad!

andypiper,
@andypiper@macaw.social avatar

@stefan nice, I might try it on our podcast site…

stefan,
@stefan@stefanbohacek.online avatar

@andypiper That would be awesome, can't wait to hear what you think!

Edent,
@Edent@mastodon.social avatar

@stefan what's the best way to download it manually? Just clone the repo - or does it need something else?

stefan,
@stefan@stefanbohacek.online avatar

@Edent Yep, just download the ZIP file and upload it to WordPress.

Thank you for giving this a try!

Edent,
@Edent@mastodon.social avatar

@stefan
Fails activation with

Warning: require_once(/home/shkspr.mobi/blog/wp-content/plugins/fediverse-embeds-wordpress-plugin-main/vendor/autoload.php): Failed to open stream: No such file or directory in /home/shkspr.mobi/blog/wp-content/plugins/fediverse-embeds-wordpress-plugin-main/index.php on line 15  
stefan,
@stefan@stefanbohacek.online avatar

@Edent Ah, sorry about that, could you please try now?

Edent,
@Edent@mastodon.social avatar

@stefan That works!
Now... can you give me a clue to the embed codes?

stefan, (edited )
@stefan@stefanbohacek.online avatar

@Edent Currently only Mastodon is supported, which gives you the embed code with an iframe, which you can add to your post via the Custom HTML block.

stefan,
@stefan@stefanbohacek.online avatar

@Edent I'll make sure to add this to the README later tonight. I am also looking into adding support to platforms that use oEmbed.

https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin#supported-platforms

Edent,
@Edent@mastodon.social avatar

@stefan aha! That sort of works.
It converts the iframe into a blockquote.
But something (probably my theme) is adding <p> to the linebreaks.

stefan,
@stefan@stefanbohacek.online avatar

@Edent Let me give this a look, thank you!

Edent,
@Edent@mastodon.social avatar

@stefan just added a fix.

stefan,
@stefan@stefanbohacek.online avatar

@Edent Thank you, really appreciate it!

Edent,
@Edent@mastodon.social avatar

@stefan
No worries!
I'm on holiday for a week, so won't be able to do any more testing.

stefan,
@stefan@stefanbohacek.online avatar

@Edent You've already done more than enough, thank you! Enjoy your time off!

morph,
@morph@morph.todon.de avatar

@stefan Ah ... it's installable yet. :)

stefan,
@stefan@stefanbohacek.online avatar
morph,
@morph@morph.todon.de avatar

@stefan Yes. WP answers with a mail about fatal error. I'll try a test post anyway.

stefan,
@stefan@stefanbohacek.online avatar

@morph Mind sharing what the error message was?

stefan,
@stefan@stefanbohacek.online avatar

@morph Ah, do you have a plugin that blocks the REST API?

morph,
@morph@morph.todon.de avatar

@stefan Yes. Only my static IP is allowed.

stefan,
@stefan@stefanbohacek.online avatar

@morph Ah, do you think it's an option to allow "/wp-json/ftf/*"? Otherwise I will have to look into a workaround.

morph,
@morph@morph.todon.de avatar

@stefan I'll have a look this evening.

stefan,
@stefan@stefanbohacek.online avatar

@morph Thank you, really appreciate it!

morph,
@morph@morph.todon.de avatar

@stefan Allowing REST API access seems not to have an effect.

I'm puzzled about the very different views of draft and published post.

screenshot from published post

stefan,
@stefan@stefanbohacek.online avatar

@morph That icon shows up for instance owners, this can be disabled in the plugin settings.

morph,
@morph@morph.todon.de avatar

@stefan Hah, I'm the King of Morphtodon. :D

stefan,
@stefan@stefanbohacek.online avatar

@morph Yeah, I wasn't too sure if this is necessary, and if this is the best way to relate the information, that's why this one icon is optional. Let me know what you think!

morph,
@morph@morph.todon.de avatar

@stefan Depends on the context in which you will publish posts. Info pulled from the original post like edited/deleted might be useful for sure.

stefan,
@stefan@stefanbohacek.online avatar

@morph Yes, those labels are always shown, definitely an important information to show.

stefan,
@stefan@stefanbohacek.online avatar
morph,
@morph@morph.todon.de avatar

@stefan I've uploaded the new version. No error message after activating.

stefan,
@stefan@stefanbohacek.online avatar

@morph Great, thank you for confirming!

stefan,
@stefan@stefanbohacek.online avatar

@morph Let me look into the embeds using the original iframe when previewing the post.

morph,
@morph@morph.todon.de avatar

@stefan What do you need for?

stefan,
@stefan@stefanbohacek.online avatar

@morph Could you give this another try? The embed renders for me when previewing a draft

morph,
@morph@morph.todon.de avatar

@stefan It seems to be the same output (just with the plugin's options disabled).
Is it helpful for you to play around as an author on the blog?

stefan,
@stefan@stefanbohacek.online avatar

@morph Sure, that would be helpful, if you don't mind!

morph,
@morph@morph.todon.de avatar

@stefan Not at all. I've made a new user for you.

stefan,
@stefan@stefanbohacek.online avatar

@morph Thank you! Feel free to DM me more details on how to get in.

stefan,
@stefan@stefanbohacek.online avatar

@morph Never mind, I got your email. Thank you!

morph,
@morph@morph.todon.de avatar

@stefan I'm writing an issue atm. :)

morph,
@morph@morph.todon.de avatar

@stefan It seems to work. Although it is just the embedded post. My lines above and under the iframe are missing.

➡️ https://morphtown.de/2023/06/19/embed-mastodon-post-test/

stefan,
@stefan@stefanbohacek.online avatar

@morph Ah, thank you, I'll look into this!

LinHead,
@LinHead@d-64.social avatar

@stefan
That is on top of my wish list. I will try that once I find the time.

stefan,
@stefan@stefanbohacek.online avatar

@LinHead Awesome, let me know what you think!

tchambers,

@stefan 🔥

Very cool!

stefan,
@stefan@stefanbohacek.online avatar

@tchambers Thank you!

dragfyre,
@dragfyre@mastodon.sandwich.net avatar

@stefan well that's cool

stefan,
@stefan@stefanbohacek.online avatar

@dragfyre Thank you!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse
  • rosin
  • Youngstown
  • osvaldo12
  • khanakhh
  • slotface
  • tacticalgear
  • InstantRegret
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • everett
  • magazineikmin
  • Durango
  • provamag3
  • GTA5RPClips
  • ethstaker
  • modclub
  • mdbf
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • megavids
  • tester
  • anitta
  • JUstTest
  • lostlight
  • All magazines