Skip to content

Created daily bible verse script, examples RSS feeds #27

@bugs181

Description

@bugs181

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

screen shot 2016-01-10 at 11 34 43 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions