Skip to content

Commit

Permalink
Merge pull request #2 from PtPrashantTripathi/main
Browse files Browse the repository at this point in the history
BhagavadGitaApi endpoint fix
  • Loading branch information
chirag127 authored Jul 22, 2023
2 parents c68f21a + 6b85aef commit 2bea278
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
fetch("https://bhagavadgitaapi.in/slok?api_key=b89a6a08cd62a233e")
const slokcount = [
47, 72, 43, 42, 29, 47, 30, 28, 34, 42, 55, 20, 35, 27, 20, 24, 28, 78,
];
const chapter = Math.floor(Math.random() * 17) + 1;
const slok = Math.floor(Math.random() * slokcount[chapter - 1]) + 1;
const gitaslok_url = `https://bhagavadgitaapi.in/slok/${chapter}/${slok}/`;

fetch(gitaslok_url)
.then((data) => data.json())
.then((sData) => {
const slokT = sData.slok;
Expand Down

0 comments on commit 2bea278

Please sign in to comment.