oblomov,
@oblomov@sociale.network avatar

So, I wanted to do a client-site embed of my feed via into a page of my website, without using , but I'm having serious doubts that this is possible at all … anybody had any luck with this?

oblomov,
@oblomov@sociale.network avatar

So after some testing and some discussion here, it seems that my best bet would be to have a modicum of either server-side or client-side processing. I'd rather not have JS dependencies for this, so maybe I'm leaning towards server-side processing, a minimal proxy that would fetch the original RSS and inject the XSLT processing instruction. I don't want to do this via CGI, so now I have to look for a way to do this in Apache itself.

77nn,

@oblomov
May I ask the reason for not wanting JS dependencies on the client-side?

oblomov,
@oblomov@sociale.network avatar

@77nn as a general rule I want the site content to be fully accessible without JS, so JS is restricted to cosmetic improvements: the sidebar menus in the index pages (that could actually be done at page creation site anyway), the share-to-Mastodon functionality (based on toothpick, that uses JS), the WEI warning (for obvious reasons).

77nn,

@oblomov
Ok, thanks fro explaining

oblomov,
@oblomov@sociale.network avatar

OK, I've had definitive confirmation that Mastodon prevents embedding (X-Frame-Options: deny) of the RSS feeds, so that way is completely precluded. So server-side or client-site scripting is a must. I'm rethinking the Apache SSI idea I was pondering about because, among other things, I dislike depending on a specific server for the functionality. I'm afraid JS will be the only way to go. I'm not happy about it, but at this point it beats the alternatives.

oblomov,
@oblomov@sociale.network avatar

Oh great, to make things worse I'm now hitting a 22 years old @mozilla #Firefox issue
https://bugzilla.mozilla.org/show_bug.cgi?id=98168
#Mastodon (correctly) encodes the HTML in the description of the RSS, but I can't “unencode” it because the #Mozilla developers refuse to implement disable-output-escaping=yes.

Brilliant.

oblomov,
@oblomov@sociale.network avatar

OK, after having worked around the #Firefox deficiency, I've completed my client-side “embed my Mastodon RSS feed in my user profile page” on my website.

Can't say I'm unhappy with the result, even though some tuning is probably still necessary (those dates, for example …)

http://wok.oblomov.eu/user/Oblomov/

julian,
@julian@fietkau.social avatar

@oblomov Nice work! I've done the same thing for https://fietkau.me but I used a DOMParser instead of an XSLTProcessor. I guess that way I dodged the Firefox issue you had.

I totally took the easy way out with the dates and just sliced up the string a bit. 🙂 I don't post enough for the time of day to matter.

juliangonggrijp,

@oblomov Where did you get stuck? It's been ages (literally more than 10 years) since I did anything with XSLT, but I seem to recall that you could just link the XSLT description as a "stylesheet" inside the XML document and the browser would do the rest for you.

oblomov,
@oblomov@sociale.network avatar

@juliangonggrijp I have an XSLT to convert the RSS to HTML. Where I'm getting stuck is in having an iframe that links directly to the Mastodon RSS and applies the XSLT. For some reason my browser always tries to download the RSS instead. I suspect Mastodon serves it with headers that recommend downloading instead of embedding, although I haven't checked yet.

oblomov,
@oblomov@sociale.network avatar

@juliangonggrijp it's either that or the syntax I'm using to apply an XSLT to an XML in an iframe is wrong (<iframe src='https://blah/rss' xslt='path/to.xslt'>)

juliangonggrijp,

@oblomov I haven't heard of that iframe attribute before, though that could just be me. At the time, I declared the stylesheet within the XML document (which would also require scripting either server- or client-side). The browser should show you the headers that Mastodon is sending the RSS with if you refresh the page with the dev tools open (network tab).

oblomov,
@oblomov@sociale.network avatar

@juliangonggrijp I found the indication of the attribute on the web, it might be wrong. Adding the XSLT to the XML itself isn't trivial, since I'm fetching the Mastodon RSS. I guess I'll have to do some server-side manipulation 8-/

juliangonggrijp,

@oblomov Ah, you also don't have a server-side script of some sort that can fix the headers?

oblomov,
@oblomov@sociale.network avatar

@juliangonggrijp I was hoping to not have to do anything server-side but it looks like it won't be possible 8-(

juliangonggrijp,

@oblomov Yeah I understand your disappointment. In my experience, there is not much you can do without at least some scripting on either the server or the client. Then again, even a little bit of scripting can often already get you a long way.

skwee357,

@oblomov Not sure with your specific question, but I was considering to parse the rss fees at build time (my website is statically generated), and publish the posts on my website

oblomov,
@oblomov@sociale.network avatar

@skwee357 that's the way I'll go, but I update my website sporadically, so this would make the stream obsolete very quickly unless I automate it.

skwee357,

@oblomov If you use netlify or vercel, they have webhook for redeploy. You can use something like IFTT that triggers a redeploy every hour for example

MikeEL,
@MikeEL@mastodon.social avatar

@oblomov

Friom your description, it sounds possible, if you include the RSS namespace.

Been too long since using XSLT to recall specific issues.

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