-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgenerate-snapshot.js
20 lines (15 loc) · 912 Bytes
/
generate-snapshot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const fs = require('fs')
const jsonfeedToRSS = require('./')
const jsonfeedToRSSObj = require('./jsonfeed-to-rss-object')
const extendedFeed = require('./snapshots/extended-feed.json')
const readmeFeed = require('./snapshots/readme-feed.json')
const podcastFeed = require('./snapshots/podcast-feed.json')
const podcastOpts = require('./snapshots/podcast-opts.json')
const rssObj = jsonfeedToRSSObj(extendedFeed)
const rssFeed = jsonfeedToRSS(extendedFeed)
fs.writeFileSync('snapshots/extended-feed-rss.xml', rssFeed)
fs.writeFileSync('snapshots/extended-feed-rss.json', JSON.stringify(rssObj, null, ' '))
fs.writeFileSync('snapshots/readme-feed-rss.xml', jsonfeedToRSS(readmeFeed))
fs.writeFileSync('snapshots/podcast-feed-rss.xml', jsonfeedToRSS(podcastFeed, podcastOpts))
fs.writeFileSync('snapshots/podcast-no-itunes-feed-rss.xml', jsonfeedToRSS(podcastFeed))
console.log('update snapshot snapshot.xml')