JAYA SHEELAT RUTH PUSHPA LATHA
Published

Bible Bee

A wonderful skill called BibleBee which tells you amazing unknown facts about THE GREATEST MAN WHO EVER LIVED ON THE EARTH - JESUS CHRIST. L

IntermediateFull instructions provided630
Bible Bee

Things used in this project

Story

Read more

Schematics

customer flow diagram

Code

index.js

JavaScript
/**Jesus is Lord**//**"BIBLE FACTS:",    Copyright JAYASHEELA. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*//** * This example has no external dependencies or session management, and shows the most basic way to create a Lambda function for handling Alexa Skill requests. * * Examples: * One-shot model: *  User: "Alexa, ask BibleBee for a Bible fact" *  Alexa: "Here's your Bible Fact: ..." *//** * App ID for the skill */var APP_ID = undefined; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";/** * Array containing Bible FACTS. */var BIBLE_FACTS = [		"The system of chapters in the Holy Bible was introduced in A.D. 1238 by Cardinal Hugo de S. Caro.",                "The verse notations were added in 1551 by Robertus Stephanus, after the advent of printing.",               "A Bible in the University of Gottingen is written on 2,470 palm leaves.",                "According to statistics from Wycliffe International, the Society of Gideons, and the International Bible Society, the number of new Bibles that are sold, given away, or otherwise distributed in the United States is about 168,000 per day.",                "The Bible can be completely read aloud in 70 hours.",                "The Holy Bible is the most influential and most popular book in history",                "The Bible can be read aloud in 70 hours",                "There are 8,674 different Hebrew words in the Bible, 5,624 different  Greek words, and 12,143 different English words in the King James Version. ",                "According to statistics from Wycliffe International, the Society of Gideons, and the International Bible Society, the number of new Bibles that are sold, given away, or otherwise distributed in the United States is about 168,000 per day.",                "Number of books in the Bible: 66  (39  old testament, 27 new testament)",                "The system of chapters was introduced in A.D. 1238 by Cardinal Hugo de S. Caro",                "There are .. Chapters: 1,189 (929 old testament, 260 new testament)",                "The original manuscripts did not contain the chapter and verse divisions in the numbered form familiar to modern readers.",                "The system of using verses was introduced in 1551 by Robertus Stephanus",                "Number of Verses: 31,102 (23,145 old testament, 7,957 new testament)",                "Number of Words: 783,137 (602,585 old testament, 180,552 new testament)",                "Number of Letters: 3,116,480 (2,278,100  old testament, 838,380 new testament)",                "Number of promises given in the Bible: 1,260",                "Number of Commands: 6,468",                "Number of Predictions: over 8,000",                "Number of Fulfilled prophecy: 3,268 verses",                "Number of Unfulfilled prophecy: 3,140",                "Number of Number of questions: 3,294",                "Longest name: Mahershalalhashbaz (Isaiah 8:1) & Jonathelemrechokim (Psalms 56:1-13)",                "Longest verse: Esther 8:9 (78 words) (Revelation 20:4)",                "Shortest verse: John 11:35 (2 words: “Yahushua wept”).  This is the King James Bible.  Some Bibles might be Job 3:2 (Job said.) but King James has that as “Job answered” which is longer than Jesus wept. (John 11:35 is the shortest verse in the new testament)",                "Shortest chapter (by number of words): Psalm 117 (by number of words)",                "Longest book: Psalms (150 chapters) (Luke – new testament)",                "Shortest book (by number of words): 3 John (Obadiah – old testament)",                "Longest chapter: Psalm 119 (176 verses) (Luke 1- new testament)",                "Number of times the word “God” appears: 4,094",                "Number of times the word “Lord” appears: 6,781",                "Number of different authors: 40",                "The Author with the Most Books:  Moses is credited with writing the first 5 books in the Old Testament, & Paul wrote a total of 14 books in the New Testament",                "Number of languages the Bible has been translated into: over 1,200",                "There are about 2.5 Billion to 6 Billion copies sold",                "Thomas Cranmer (1489-1556), Archbishop of Canterbury, reportedly memorized the entire Bible! Some historians record that it took him only three months to accomplish this amazing feat!",              "The oldest MS. of the Bible in the British Museum is the “Codex Alexandrinus.” Parts of the New Testament are omitted. The “Codex Vaticanus” is the oldest in the Vatican Library at Rome.",                "The most frequently cited old testament verse in the new testament is Psalm 110:1 YHWH said unto my master, Sit thou at my right hand, until I make thine enemies thy footstool. – quoted 18 times Matt. 22:44, 26:64, Mark 12:36, 14:62, 16:19, Luke 20:42-43, 22:69, Acts 2:34-35, Rom. 8:34, 1 Cor. 15:25, Eph. 1:20, Col. 3:1, Heb.1:3, 13, 8:1, 10:12-13, 12:2 ",                "The most mentioned men in the bible is David, mentioned 1118 times",                "The book of Isaiah is the most old testament book referred to in the New Testament.",                "The first human is recorded to be Adam in Genesis 2:7",                "The oldest man is recorded to be Methuselah, son of Enoch, who lived to be 969 in Genesis 5:27",               "Man was spoken to by a donkey,  in Numbers 22:28-30.",                "Goliath was recorded to be the tallest man with a bed measuring 13½ feet in length and 6 feet in width in Deuteronomy 3:11. (some say he was between 10-11ft)",                "Samson is recorded to be the strongest man in Judges 14:6 & Judges 15:5",                "The sun is recorded to have stood still for a whole day in Joshua 10:13.",                "There was an army with 700 left-handed men in Judges 20:16.",                "Absalom’s hair weighed about 6 pounds when it was cut annually, 2 Samuel 14:26.",                "A man who had 12 fingers and 12 toes, 2 Samuel 21:20.",                "King Solomon was the wisest person recorded that ever lived in 1 kings 3:12 & 10:24",                "King Solomon was the richest man ever recorded in 1 Kings 10:14-29",                "King Solomon had hundred wives and three hundred concubines in 1 Kings 11:3 (one can only assume he also had the most children because of this, but it is not recorded to my knowledge)",                "Eglon the Moabite King, who was killed by Ehud, is recorded to be the fattest person in Judge 3:17",     "Moses is recorded to be the meekest in Numbers 12:3",                "Nebuchadnezzar was the proudest man recorded in Daniel 4, whom YHWH humbled.",                "A day the sun went backward, Is Isaiah 38:8.",                "A prostitute who was an ancestor of Christ, Matthew 1:5",                "There are 17 historical books, 5 poetic books & 17 prophetic books in the Old Testament.",                "There are 4 Gospels, 1 historical book, 22 letters & 1 apocalyptic book in the New Testament.",               "Characteristics and traits of people were an important aspect of names in ancient Israel. For example the name Nabal means “senseless and fool”, nd Abigail indicated that this is what her husband amounted to (1 Sam 25:25)",                "The creation of a Sabbath Day created the first week, many nations call the 7th day of the week Sabbath to further prove this & also Genesis 2:1-3",                "The Bible revealed that the earth was round in 1000 B.C., 2500 years before “man discovered it” for himself in 1500 by sailing around the earth. Read Isaiah 40:22, & Proverbs 8:27",                "The Hydrological water cycle was revealed to many of the prophets before Roman engineer named Marcus Vitruvius discovered it. Read Ecclesiastes 1:6-7, Ecclesiastes 11:3, Job 26:8, Job 36:27-28, & Amos 9:6",                "THE EARTH IS SUSPENDED IN NOTHING Job 26:7",                "The sea has valley’s in the sea, was revealed to us in my books before Science “discovered it”, such as in Psalms 18:15, Jonah 2:6, 2 Samuel 22:16",                "The nations were afraid of the Sun, Moon & Stars because they did not understand them & even thought them to be Gods, but YHWH reveals to Jeremiah not to worry about them in Jeremiah 10:2",                "There are paths in the sea which Matthew Maury in the 1800’s discovered after reading Psalms 8:8.  He was an officer in the United States Navy, who believed his Bible & went out to prove this for himself. Maury wrote the first book on oceanography and became known as “the pathfinder of the seas”— “The father of modern navigation.”",                "The ways of the stars (Pleiades, Orion, and Arcturus) was revealed to Job in Job 38:31-32.",                "YHWH prophesies about 150 years in advance, who by name, would conquer Babylon." ],            "SKILL_NAME" : "British Bible Facts",            "GET_FACT_MESSAGE" : "Here's your Bible fact: ",            "HELP_MESSAGE" : "You can say BibleBee tell me a Bible fact, or, you can say exit... What can I help you with?",            "HELP_REPROMPT" : "What can I help you with?",            "STOP_MESSAGE" : "Goodbye!"        }    },    "en-US": {        "translation": {            "FACTS": [	"The system of chapters in the Holy Bible was introduced in A.D. 1238 by Cardinal Hugo de S. Caro.",                "The verse notations were added in 1551 by Robertus Stephanus, after the advent of printing.",               "A Bible in the University of Gottingen is written on 2,470 palm leaves.",                "According to statistics from Wycliffe International, the Society of Gideons, and the International Bible Society, the number of new Bibles that are sold, given away, or otherwise distributed in the United States is about 168,000 per day.",                "The Bible can be completely read aloud in 70 hours.",                "The Holy Bible is the most influential and most popular book in history",                "The Bible can be read aloud in 70 hours",                "There are 8,674 different Hebrew words in the Bible, 5,624 different  Greek words, and 12,143 different English words in the King James Version. ",                "According to statistics from Wycliffe International, the Society of Gideons, and the International Bible Society, the number of new Bibles that are sold, given away, or otherwise distributed in the United States is about 168,000 per day.",                "Number of books in the Bible: 66  (39  old testament, 27 new testament)",                "The system of chapters was introduced in A.D. 1238 by Cardinal Hugo de S. Caro",                "There are .. Chapters: 1,189 (929 old testament, 260 new testament)",                "The original manuscripts did not contain the chapter and verse divisions in the numbered form familiar to modern readers.",                "The system of using verses was introduced in 1551 by Robertus Stephanus",                "Number of Verses: 31,102 (23,145 old testament, 7,957 new testament)",                "Number of Words: 783,137 (602,585 old testament, 180,552 new testament)",                "Number of Letters: 3,116,480 (2,278,100  old testament, 838,380 new testament)",                "Number of promises given in the Bible: 1,260",                "Number of Commands: 6,468",                "Number of Predictions: over 8,000",                "Number of Fulfilled prophecy: 3,268 verses",                "Number of Unfulfilled prophecy: 3,140",                "Number of Number of questions: 3,294",                "Longest name: Mahershalalhashbaz (Isaiah 8:1) & Jonathelemrechokim (Psalms 56:1-13)",                "Longest verse: Esther 8:9 (78 words) (Revelation 20:4)",                "Shortest verse: John 11:35 (2 words: “Yahushua wept”).  This is the King James Bible.  Some Bibles might be Job 3:2 (Job said.) but King James has that as “Job answered” which is longer than Jesus wept. (John 11:35 is the shortest verse in the new testament)",                "Shortest chapter (by number of words): Psalm 117 (by number of words)",                "Longest book: Psalms (150 chapters) (Luke – new testament)",                "Shortest book (by number of words): 3 John (Obadiah – old testament)",                "Longest chapter: Psalm 119 (176 verses) (Luke 1- new testament)",                "Number of times the word “God” appears: 4,094",                "Number of times the word “Lord” appears: 6,781",                "Number of different authors: 40",                "The Author with the Most Books:  Moses is credited with writing the first 5 books in the Old Testament, & Paul wrote a total of 14 books in the New Testament",                "Number of languages the Bible has been translated into: over 1,200",                "There are about 2.5 Billion to 6 Billion copies sold",                "Thomas Cranmer (1489-1556), Archbishop of Canterbury, reportedly memorized the entire Bible! Some historians record that it took him only three months to accomplish this amazing feat!",              "The oldest MS. of the Bible in the British Museum is the “Codex Alexandrinus.” Parts of the New Testament are omitted. The “Codex Vaticanus” is the oldest in the Vatican Library at Rome.",                "The most frequently cited old testament verse in the new testament is Psalm 110:1 YHWH said unto my master, Sit thou at my right hand, until I make thine enemies thy footstool. – quoted 18 times Matt. 22:44, 26:64, Mark 12:36, 14:62, 16:19, Luke 20:42-43, 22:69, Acts 2:34-35, Rom. 8:34, 1 Cor. 15:25, Eph. 1:20, Col. 3:1, Heb.1:3, 13, 8:1, 10:12-13, 12:2 ",                "The most mentioned men in the bible is David, mentioned 1118 times",                "The book of Isaiah is the most old testament book referred to in the New Testament.",                "The first human is recorded to be Adam in Genesis 2:7",                "The oldest man is recorded to be Methuselah, son of Enoch, who lived to be 969 in Genesis 5:27",               "Man was spoken to by a donkey,  in Numbers 22:28-30.",                "Goliath was recorded to be the tallest man with a bed measuring 13½ feet in length and 6 feet in width in Deuteronomy 3:11. (some say he was between 10-11ft)",                "Samson is recorded to be the strongest man in Judges 14:6 & Judges 15:5",                "The sun is recorded to have stood still for a whole day in Joshua 10:13.",                "There was an army with 700 left-handed men in Judges 20:16.",                "Absalom’s hair weighed about 6 pounds when it was cut annually, 2 Samuel 14:26.",                "A man who had 12 fingers and 12 toes, 2 Samuel 21:20.",                "King Solomon was the wisest person recorded that ever lived in 1 kings 3:12 & 10:24",                "King Solomon was the richest man ever recorded in 1 Kings 10:14-29",                "King Solomon had hundred wives and three hundred concubines in 1 Kings 11:3 (one can only assume he also had the most children because of this, but it is not recorded to my knowledge)",                "Eglon the Moabite King, who was killed by Ehud, is recorded to be the fattest person in Judge 3:17",     "Moses is recorded to be the meekest in Numbers 12:3",                "Nebuchadnezzar was the proudest man recorded in Daniel 4, whom YHWH humbled.",                "A day the sun went backward, Is Isaiah 38:8.",                "A prostitute who was an ancestor of Christ, Matthew 1:5",                "There are 17 historical books, 5 poetic books & 17 prophetic books in the Old Testament.",                "There are 4 Gospels, 1 historical book, 22 letters & 1 apocalyptic book in the New Testament.",               "Characteristics and traits of people were an important aspect of names in ancient Israel. For example the name Nabal means “senseless and fool”, nd Abigail indicated that this is what her husband amounted to (1 Sam 25:25)",                "The creation of a Sabbath Day created the first week, many nations call the 7th day of the week Sabbath to further prove this & also Genesis 2:1-3",                "The Bible revealed that the earth was round in 1000 B.C., 2500 years before “man discovered it” for himself in 1500 by sailing around the earth. Read Isaiah 40:22, & Proverbs 8:27",                "The Hydrological water cycle was revealed to many of the prophets before Roman engineer named Marcus Vitruvius discovered it. Read Ecclesiastes 1:6-7, Ecclesiastes 11:3, Job 26:8, Job 36:27-28, & Amos 9:6",                "THE EARTH IS SUSPENDED IN NOTHING Job 26:7",                "The sea has valley’s in the sea, was revealed to us in my books before Science “discovered it”, such as in Psalms 18:15, Jonah 2:6, 2 Samuel 22:16",                "The nations were afraid of the Sun, Moon & Stars because they did not understand them & even thought them to be Gods, but YHWH reveals to Jeremiah not to worry about them in Jeremiah 10:2",                "There are paths in the sea which Matthew Maury in the 1800’s discovered after reading Psalms 8:8.  He was an officer in the United States Navy, who believed his Bible & went out to prove this for himself. Maury wrote the first book on oceanography and became known as “the pathfinder of the seas”— “The father of modern navigation.”",                "The ways of the stars (Pleiades, Orion, and Arcturus) was revealed to Job in Job 38:31-32.",                "YHWH prophesies about 150 years in advance, who by name, would conquer Babylon."];/** * The AlexaSkill prototype and helper functions */var AlexaSkill = require('./AlexaSkill');var Fact = function () {    AlexaSkill.call(this, APP_ID);};// Extend AlexaSkillFact.prototype = Object.create(AlexaSkill.prototype);Fact.prototype.constructor = Fact;Fact.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {    //console.log("onSessionStarted requestId: " + sessionStartedRequest.requestId + ", sessionId: " + session.sessionId);    // any initialization logic goes here};Fact.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {    //console.log("onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);    handleNewFactRequest(response);};/** * Overridden to show that a subclass can override this function to teardown session state. */Fact.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {    //console.log("onSessionEnded requestId: " + sessionEndedRequest.requestId + ", sessionId: " + session.sessionId);    // any cleanup logic goes here};Fact.prototype.intentHandlers = {    "GetNewFactIntent": function (intent, session, response) {        handleNewFactRequest(response);    },    "AMAZON.HelpIntent": function (intent, session, response) {        response.ask("You can say BibleBee tell me a Bible fact, or, you can say exit... What can I help you with?", "What can I help you with?");    },    "AMAZON.StopIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    },    "AMAZON.CancelIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    }};/** * Gets a random new fact from the list and returns to the user. */function handleNewFactRequest(response) {    // Get a random Bible fact from the Bible FACTS list    var factIndex = Math.floor(Math.random() * BIBLE_FACTS.length);    var randomFact = BIBLE_FACTS[factIndex];    // Create speech output    var speechOutput = "Here's your Bible fact: " + randomFact;    var cardTitle = "Your Bible Fact";    response.tellWithCard(speechOutput, BibleBee, speechOutput);}// Create the handler that responds to the Alexa Request.exports.handler = function (event, context) {    // Create an instance of the BibleBee skill.    var fact = new Fact();    fact.execute(event, context);};

IntentSchema

JSON
{
  "intents": [
    {
      "intent": "GetNewFactIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    },
    {
      "intent": "AMAZON.StopIntent"
    },
    {
      "intent": "AMAZON.CancelIntent"
    }
  ]
 }

SampleUtterances

Tex
GetNewFactIntent a fact
GetNewFactIntent a space fact
GetNewFactIntent tell me a fact
GetNewFactIntent tell me a space fact
GetNewFactIntent give me a fact
GetNewFactIntent give me a space fact
GetNewFactIntent tell me trivia
GetNewFactIntent tell me a space trivia
GetNewFactIntent give me trivia
GetNewFactIntent give me a space trivia
GetNewFactIntent give me some information
GetNewFactIntent give me some space information
GetNewFactIntent tell me something
GetNewFactIntent give me something

AlexaSkill

JavaScript
/**Jesus is Lord*//**    Copyright JAYASHEELA. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONSOFANYKIND,eitherexpress or implied. See the License for the specific language governing permissions and limitationsunder the License.*/'use strict';function AlexaSkill(appId) {    this._appId = amzn1.ask.skill.e4d5abba-0a53-451e-9d86-ec45102a94b0;}AlexaSkill.speechOutputType = {    PLAIN_TEXT: 'PlainText',    SSML: 'SSML'}AlexaSkill.prototype.requestHandlers = {    LaunchRequest: function (event, context, response) {        this.eventHandlers.onLaunch.call(this, event.request, event.session, response);    },    IntentRequest: function (event, context, response) {        this.eventHandlers.onIntent.call(this, event.request, event.session, response);    },    SessionEndedRequest: function (event, context) {        this.eventHandlers.onSessionEnded(event.request, event.session);        context.succeed();    }};/** * Override any of the eventHandlers as needed */AlexaSkill.prototype.eventHandlers = {    /**     * Called when the session starts.     * Subclasses could have overriden this function to open any necessary resources.     */    onSessionStarted: function (sessionStartedRequest, session) {    },    /**     * Called when the user invokes the skill without specifying what they want.     * The subclass must override this function and provide feedback to the user.     */    onLaunch: function (launchRequest, session, response) {        throw "onLaunch should be overriden by subclass";    },    /**     * Called when the user specifies an intent.     */    onIntent: function (intentRequest, session, response) {        var intent = intentRequest.intent,            intentName = intentRequest.intent.name,            intentHandler = this.intentHandlers[intentName];        if (intentHandler) {            console.log('dispatch intent = ' + intentName);            intentHandler.call(this, intent, session, response);        } else {            throw 'Unsupported intent = ' + intentName;        }    },    /**     * Called when the user ends the session.     * Subclasses could have overriden this function to close any open resources.     */    onSessionEnded: function (sessionEndedRequest, session) {    }};/** * Subclasses should override the intentHandlers with the functions to handle specific intents. */AlexaSkill.prototype.intentHandlers = {};AlexaSkill.prototype.execute = function (event, context) {    try {        console.log("session applicationId: " + event.session.application.applicationId);        // Validate that this request originated from authorized source.        if (this._appId && event.session.application.applicationId !== this._appId) {            console.log("The applicationIds don't match : " + event.session.application.applicationId + " and "                + this._appId);            throw "Invalid applicationId";        }        if (!event.session.attributes) {            event.session.attributes = {};        }        if (event.session.new) {            this.eventHandlers.onSessionStarted(event.request, event.session);        }        // Route the request to the proper handler which may have been overriden.        var requestHandler = this.requestHandlers[event.request.type];        requestHandler.call(this, event, context, new Response(context, event.session));    } catch (e) {        console.log("Unexpected exception " + e);        context.fail(e);    }};var Response = function (context, session) {    this._context = context;    this._session = session;};function createSpeechObject(optionsParam) {    if (optionsParam && optionsParam.type === 'SSML') {        return {            type: optionsParam.type,            ssml: optionsParam.speech        };    } else {        return {            type: optionsParam.type || 'PlainText',            text: optionsParam.speech || optionsParam        }    }}Response.prototype = (function () {    var buildSpeechletResponse = function (options) {        var alexaResponse = {            outputSpeech: createSpeechObject(options.output),            shouldEndSession: options.shouldEndSession        };        if (options.reprompt) {            alexaResponse.reprompt = {                outputSpeech: createSpeechObject(options.reprompt)            };        }        if (options.cardTitle && options.cardContent) {            alexaResponse.card = {                type: "Simple",                title: options.cardTitle,                content: options.cardContent            };        }        var returnResult = {                version: '1.0',                response: alexaResponse        };        if (options.session && options.session.attributes) {            returnResult.sessionAttributes = options.session.attributes;        }        return returnResult;    };    return {        tell: function (speechOutput) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                shouldEndSession: true            }));        },        tellWithCard: function (speechOutput, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: true            }));        },        ask: function (speechOutput, repromptSpeech) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                shouldEndSession: false            }));        },        askWithCard: function (speechOutput, repromptSpeech, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: false            }));        }    };})();module.exports = AlexaSkill;

Credits

JAYA SHEELA

JAYA SHEELA

0 projects • 0 followers
T RUTH PUSHPA LATHA

T RUTH PUSHPA LATHA

3 projects • 2 followers
Thanks to T RUTH PUSHPA LATHA .

Comments