Blog/themes/freemind/source/js/foxsay.js
2022-08-02 07:36:34 +08:00

19 lines
484 B
JavaScript

let parser = new RSSParser();
parser.parseURL('https://foxsay.southfox.me/@SouthFox.rss', function(err, feed) {
if (err) throw err;
for (let i = 0; i < 10; i++) {
const entry = feed.items[i];
printPost(entry);
}
});
function printPost(entry) {
section = document.createElement("section");
section.classList.add('item');
popContent = entry.contentSnippet;
section.innerHTML = popContent;
blogs = document.getElementById('foxsay');
blogs.append(section);
}