Skip to content

Instantly share code, notes, and snippets.

@vini-btc
Created December 23, 2020 08:13
Show Gist options
  • Save vini-btc/ab09209237cfa8f01c490dc3ab0dd9d8 to your computer and use it in GitHub Desktop.
Save vini-btc/ab09209237cfa8f01c490dc3ab0dd9d8 to your computer and use it in GitHub Desktop.
Embedding Medium Posts - 3
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