-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
Created this at the request of someone. This script will return a daily bible verse from abibleverse.org
This script can be repurposed for any type of RSS feed with ease and additionally shows how to consume nodejs apps with Today-Scripts.
Expects feed-read to be installed and that your node script file can locate it.
npm install feed-read
bible-rss.js
var feed = require("feed-read")
var bibleverseUrl = "http://abibleverse.org/main.xml"
var dailyBibleQuote = {
verse: "",
text: "",
providedBy: {
source: "",
link: "",
name: ""
}
}
feed(bibleverseUrl, function(err, RSS) {
if (err) throw err
dailyBibleQuote.providedBy = RSS[0].feed
dailyBibleQuote.verse = RSS[1].title
dailyBibleQuote.text = RSS[1].content.replace(dailyBibleQuote.verse + " ", "")
// Format for console output, especially the 'Today Script' app
console.log(dailyBibleQuote.verse + "\n" + dailyBibleQuote.text + "\nBy: " + dailyBibleQuote.providedBy.name)
})
Setup Today Script with the label Daily bible verse
and the snippet's code as /usr/local/bin/node /Users/$user/path of file/bible-rss.js
Metadata
Metadata
Assignees
Labels
No labels
