Any recommendations for a Ruby oEmbed library? I’d like to fetch cards for popular services on the server side without adding any external javascript to my pages.

I now take the returned javascript out manually for Twitter cards (github.com/jeffkreeftmeijer/up). 😕

@jkreeftmeijer I've briefly used ruby-oembed, but it's been years ago so I don't know its current state

Follow

@judofyr It’s been unmaintained since 2017, but I’m fine with updating some of an existing library instead of writing my own from scratch. I’ll take it for a spin soon. Thanks!

@jkreeftmeijer let me know if you want commit access to the repo :)

@judofyr Not sure if it’s something I’d like to maintain, but I’ll be sure to keep that in mind in case I have some improvements to push. :)

@judofyr Got it working for Twitter by forcing the encoding to UTF-8, and running JSON responses through JSON.parse instead of whatever it did before.

It seems to have great provider support, but I’m getting Twitter’s unparsed HTML response (with that javascript tag), which is to be expected, actually. I’ll check how Mastodon does this—as it seems to only get the tweet content—sometime soon. Thanks for your help! :)

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!