aboutsummaryrefslogtreecommitdiff
path: root/scripts/atom.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/atom.js')
-rw-r--r--scripts/atom.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/atom.js b/scripts/atom.js
new file mode 100644
index 0000000..878df05
--- /dev/null
+++ b/scripts/atom.js
@@ -0,0 +1,22 @@
+const RSS = require('rss');
+
+const feedName = process.argv[2];
+const feedSrc = process.argv[3];
+
+const feed = new RSS({
+ title: `Buku feed tag for '${feedName}'.`,
+ description: `Buku feed tag for ${feedName}`,
+});
+
+const items = require(feedSrc);
+items.forEach(({ title, description, uri }) => {
+ feed.item({
+ title,
+ description,
+ url: uri
+ });
+});
+
+const xml = feed.xml({indent: true});
+
+console.log(xml);