About This Method
Mastodon instances provide a public RSS feed for each user's public posts, found at
https://[instance.domain]/users/[username].rss
.
This example uses client-side JavaScript to attempt to fetch this RSS feed, parse the XML content using
the browser's built-in DOMParser
, and then render the latest posts below.
The RSS feed only includes the user's public, original posts. It excludes replies
and boosts.
The standard RSS format lacks a specific field for Content Warnings (CWs). Posts with
CWs will have their full content displayed immediately.
Fetching resources (like RSS feeds) directly from a different domain using JavaScript is often blocked
by browser security policies (CORS). This example
may not work reliably unless the Mastodon
instance's server is configured to allow requests from your website's origin, or if you use a
CORS proxy. It is included mainly as a demonstration of
parsing the feed format. Check the browser console for errors if the feed doesn't load.