Code Monkey home page Code Monkey logo

youversion-api-npm's Introduction

YouVersion-API

A simple module to get the Verse of the Day and any verse you would like.

Installation

Note I use pnpm in these examples. NPM will also work if you don't have or want to install pnpm

First step is of course installing the module

pnpm install @glowstudent/youversion

Usage

Import the library

const YouVersion = require("@glowstudent/youversion");

Getting the verse of the day:

Note Version is not yet configurable

const YouVersion = require("@glowstudent/youversion");

(async () => {
  console.log(await YouVersion.getVerseOfTheDay());
})();
{
  "citation": "Hebrews 11:1 (NIV)",
  "passage": "Now faith is confidence in what we hope for and assurance about what we do not see."
}

Getting any verse:

const YouVersion = require("@glowstudent/youversion");

(async () => {
  console.log(await YouVersion.getVerse("John", "3", "16", "KJV"));
})();
{
  "citation": "John 3:16 KJV",
  "passage": "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."
}

Responses

Requests return a JSON object and a status code.

Good Respsonses

Good responses will return a JSON with a citation and a passage.

{
  "citation": "John 3:16 NLT",
  "passage": "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."
}

Bad Responses

If book is not specified or cannot be read it will return an error.

{
  "code": 400,
  "message": "Missing field 'book'"
}

Trying to access a book that does not exist will prompt a similar response but with a different error message

{
  "code": 400,
  "message": "Could not find book 'Coffee' by name or alias."
}

Books and Aliases

Books and Aliases
Book Alias
Genesis GEN
Exodus EXO
Leviticus LEV
Numbers NUM
Deuteronomy DEU
Joshua JOS
Judges JDG
Ruth RUT
1st Samuel 1SA
2nd Samuel 2SA
1st Kings 1KI
2nd Kings 2KI
1st Chronicles 1CH
2nd Chronicles 2CH
Ezra EZR
Nehemiah NEH
Esther EST
Job JOB
Psalms PSA
Proverbs PRO
Ecclesiastes ECC
Song of Songs SNG
Isaiah ISA
Jeremiah JER
Lamentations LAM
Ezekiel EZK
Daniel DAN
Hosea HOS
Joel JOL
Amos AMO
Obadiah OBA
Jonah JON
Micah MIC
Nahum NAM
Habakkuk HAB
Zephaniah ZEP
Haggai HAG
Zechariah ZEC
Malachi MAL
Matthew MAT
Mark MRK
Luke LUK
John JHN
Acts ACT
Romans ROM
1st Corinthians 1CO
2nd Corinthians 2CO
Galatians GAL
Ephesians EPH
Philippians PHP
Colossians COL
1st Thessalonians 1TH
2nd Thessalonians 2TH
1st Timothy 1TI
2nd Timothy 2TI
Titus TIT
Philemon PHM
Hebrews HEB
James JAS
1st Peter 1PE
2nd Peter 2PE
1st John 1JN
2nd John 2JN
3rd John 3JN
Jude JUD
Revelation REV

Versions

Versions
Versions ID
AMP 1588
ICL00D 1196
KJV 1
NIV 111
NLT 116
NR06 122
SCH2000 157
VULG 823
THSV11 174
TNCV 179
THAERV 203
NODTHNT 1907
NTV 2744
ESV 59
SBLG 156
CCB 36

Links

Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested.

License

This project is licensed under the terms of the MIT license.

youversion-api-npm's People

Contributors

darcywong00 avatar glowstudent777 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

youversion-api-npm's Issues

Verse of the Day Returning Bible.com Footer

Hi! I apologize in advance if anything is wrong--I'm new to this!

I used the exact same code in the docs, and ran across a problem.


Expected Behavior
{ citation: 'John 13:14 (NIV)', passage: 'Now that I, your Lord and Teacher, have washed your feet, you also should wash one another’s feet.' }


Actual Behavior
The module kept returning the wrong passage:
{ citation: 'John 13:14 (NIV)', passage: 'Encouraging and challenging you to seek intimacy with God every day.' }


Problem
In the VOTD typescript, I saw that you got the passage from p.text-gray-50. Upon inspection of BIble.com, I found that multiple elements correlate to this class. One of them is the footer:

Screenshot 2024-03-27 at 8 52 14 PM

Solution
I'm not sure. Maybe fetch the outer div mbs-3 border border-l-large border-black pli-1 plb-1 pis-2, and then fetching the p.text-gray-50. As far as observations go, only the VOTD is wrapped in the mbs-3 outer div.

Thank you!

I just wanted to thank you for this awesome package (or module). I wanted to create a GNOME Extension (One of the best Desktop Environments available for Linux) to show the current verse of the Day and this makes it way easier for me. And it's TypeScript - that is always good.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.