@puniko
Is your instances #rss configured differently somehow ?
This code works with other instances, but refuses to work with mk.absturztau.be
_____
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="./style.css">
<body>
<!-- partial:index.partial.html -->
<!-- partial -->
<script>
const userFeed = 'https://mk.absturztau.be/@aoikurayami.rss';
const wrapper = document.body;
const tootHTML = (description, date, url) => `
<article>
<a href="${url}">?</a> | <time>${date}</time>____________
<div>${description}</div>
</article>`;
const formatToots = (domContent, container) => {
[...domContent.querySelectorAll('item')].map(item => {
const $toot = el => item.querySelector(el).textContent;
const description = $toot('description')
const url = $toot('guid')
const date = $toot('pubDate')
container.innerHTML = container.innerHTML + tootHTML(description, date, url)
});
};
const parser = new DOMParser();
fetch(userFeed)
.then(response => {
if (response.status >= 400) {
return <p>No toots available at the moment</p>
}
return response.text();
})
.then(response => formatToots(parser.parseFromString(response, "application/xml"), wrapper));
</script>
</body>
<div id="myTimeline" class="mastodon-timeline mastodon-timeline-light"></div>
</div>
Conversation
Notices
-
Embed this notice
aoikurayami@mk.absturztau.be's status on Monday, 12-Dec-2022 23:39:38 JST aoikurayami -
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Monday, 12-Dec-2022 23:39:34 JST Puniko ? @aoikurayami this looks like code grabbing stuff from mastodon, no? since this isn't mastodon, but foundkey, this probably wont work the same way. also i'm not aware that a pofile feed is provided as rss on foundkey
In conversation permalink -
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Monday, 12-Dec-2022 23:42:10 JST Puniko ? @aoikurayami sorry, i dont know. never really took a look into it.
In conversation permalink -
Embed this notice
aoikurayami@mk.absturztau.be's status on Monday, 12-Dec-2022 23:42:12 JST aoikurayami @puniko
Thats sad.
Do you know html \js widgets that work for misskey ?
(Soapbox also fails btw)
Whats code grabbing ?In conversation permalink -
Embed this notice
aoikurayami@mk.absturztau.be's status on Monday, 12-Dec-2022 23:45:23 JST aoikurayami @puniko Well. I have one more widget thing that is more general and will require my user id.
Let's see how it goes.In conversation permalink Puniko ? likes this. -
Embed this notice
aoikurayami@mk.absturztau.be's status on Monday, 12-Dec-2022 23:49:08 JST aoikurayami @puniko I think I see what the issue is tho.
In the rss your "posts" are called "notes" etc.
Maybe I'll mend the code.
Could be fun.In conversation permalink Puniko ? likes this.
-
Embed this notice