Created
December 23, 2020 08:13
-
-
Save vini-btc/ab09209237cfa8f01c490dc3ab0dd9d8 to your computer and use it in GitHub Desktop.
Embedding Medium Posts - 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Parser = require('rss-parser') | |
const fs = require('fs') | |
const pug = require('pug') | |
const compiledFunction = pug.compileFile('index.pug') | |
const parser = new Parser() | |
(async () => { | |
const feed = await parser.parseURL('http://medium.com/feed/@viniwrites') | |
fs.writeFileSync('index.html', compiledFunction({ posts: feed.items })) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment