{"id":21,"date":"2025-08-18T02:14:44","date_gmt":"2025-08-18T02:14:44","guid":{"rendered":"https:\/\/isthistextinthebible.wordifysites.com\/?page_id=21"},"modified":"2026-01-30T01:04:40","modified_gmt":"2026-01-30T01:04:40","slug":"is-this-text-in-the-bible","status":"publish","type":"page","link":"https:\/\/isthistextinthebible.wordifysites.com\/","title":{"rendered":"Is This Text In The Bible"},"content":{"rendered":"\n<div class=\"gb-element-6cb2b648\">\n<div id=\"bible-search\">\n  <textarea id=\"inputText\" rows=\"5\" style=\"width:100%;\" placeholder=\"Paste your passage here...\"><\/textarea>\n  <button id=\"searchBtn\">Compare<\/button>\n  <div id=\"results\" style=\"margin-top:1em;\"><\/div>\n<\/div>\n\n<script>\nasync function loadBible() {\n  const response = await fetch('https:\/\/isthistextinthebible.wordifysites.com\/wp-content\/uploads\/2025\/08\/bible.txt');\n  return await response.json();\n}\n\n\/\/ Normalize text into lowercase words\nfunction tokenize(text) {\n  return text\n    .toLowerCase()\n    .replace(\/[^a-z\\s]\/g, \"\")\n    .split(\/\\s+\/)\n    .filter(w => w.length > 0);\n}\n\n\/\/ Highlight matches for specific words\nfunction highlightText(verseText, words) {\n  let result = verseText;\n  words.forEach(word => {\n    const re = new RegExp(`\\\\b(${word})\\\\b`, \"gi\");\n    result = result.replace(re, \"<mark>$1<\/mark>\");\n  });\n  return result;\n}\n\ndocument.getElementById('searchBtn').addEventListener('click', async () => {\n  const input = document.getElementById('inputText').value.trim();\n  if (!input) return;\n\n  const resultsDiv = document.getElementById('results');\n  resultsDiv.innerHTML = \"<p><em>Loading...<\/em><\/p>\";\n\n  const bibleData = await loadBible();\n  const inputWords = tokenize(input);\n\n  let foundAny = false;\n  let matches = [];\n\n  inputWords.forEach(word => {\n    const verses = bibleData.filter(v => {\n      return tokenize(v.text).includes(word);\n    });\n    if (verses.length > 0) {\n      foundAny = true;\n      verses.forEach(v => {\n        matches.push({\n          ...v,\n          highlighted: highlightText(v.text, [word]),\n          matchedWord: word\n        });\n      });\n    }\n  });\n\n  resultsDiv.innerHTML = \"\";\n\n  if (!foundAny) {\n    resultsDiv.innerHTML = \"<p><strong>None of these words are in the Bible.<\/strong><\/p>\";\n    return;\n  }\n\n  const countInfo = document.createElement(\"p\");\n  countInfo.innerHTML = `<strong>${matches.length}<\/strong> matches found for words: ${[...new Set(matches.map(m => m.matchedWord))].join(\", \")}`;\n  resultsDiv.appendChild(countInfo);\n\n  const listDiv = document.createElement(\"div\");\n  resultsDiv.appendChild(listDiv);\n\n  matches.slice(0, 50).forEach(v => {\n    const p = document.createElement(\"p\");\n    p.innerHTML = `<strong>${v.book} ${v.chapter}:${v.verse}<\/strong> \u2014 ${v.highlighted}`;\n    listDiv.appendChild(p);\n  });\n\n  if (matches.length > 50) {\n    const moreBtn = document.createElement(\"button\");\n    moreBtn.textContent = \"Show all results\";\n    moreBtn.onclick = () => {\n      listDiv.innerHTML = \"\";\n      matches.forEach(v => {\n        const p = document.createElement(\"p\");\n        p.innerHTML = `<strong>${v.book} ${v.chapter}:${v.verse}<\/strong> \u2014 ${v.highlighted}`;\n        listDiv.appendChild(p);\n      });\n      moreBtn.remove();\n    };\n    resultsDiv.appendChild(moreBtn);\n  }\n});\n<\/script>\n\n\n\n<div id=\"handwritten-tool\"><\/div>\n\n<script>\n(function() {\n    const host = document.getElementById('handwritten-tool');\n    const shadow = host.attachShadow({ mode: 'open' });\n\n    \/\/ CSS to force horizontal alignment and reset styles\n    shadow.innerHTML = `\n        <style>\n            :host { \n                all: initial; \n                display: block; \n                font-family: serif; \n                color: black;\n                margin: 20px 0;\n            }\n            .input-row {\n                display: flex;\n                align-items: center;\n                gap: 0px;\n                margin-bottom: 0px;\n            }\n            input, button, label, p, b { \n                all: revert; \n            }\n        <\/style>\n\n        <div class=\"input-row\">\n            <label for=\"num1\">Number 1: <\/label>\n            <input type=\"number\" id=\"num1\">\n        <\/div>\n\n        <div class=\"input-row\">\n            <label for=\"num2\">Number 2: <\/label>\n            <input type=\"number\" id=\"num2\">\n        <\/div>\n\n        <div class=\"input-row\">\n            <label for=\"num3\">Number 3: <\/label>\n            <input type=\"number\" id=\"num3\">\n        <\/div>\n\n        <button id=\"submit-btn\">submit<\/button>\n\n        <div id=\"output\"><\/div>\n    `;\n\n    shadow.getElementById('submit-btn').onclick = function() {\n        const n1 = shadow.getElementById('num1').value;\n        const n2 = shadow.getElementById('num2').value;\n        const n3 = shadow.getElementById('num3').value;\n        const display = shadow.getElementById('output');\n\n        if (n1 === \"\" || n2 === \"\" || n3 === \"\") {\n            display.innerHTML = \"<p>Please enter all numbers.<\/p>\";\n            return;\n        }\n\n        const choices = [n1, n2, n3];\n        let result;\n\n        \/\/ 25% chance for a random number (0-100), 75% for one of the inputs\n        if (Math.random() < 0.25) {\n            result = Math.floor(Math.random() * 101);\n        } else {\n            const index = Math.floor(Math.random() * choices.length);\n            result = choices[index];\n        }\n\n        display.innerHTML = \"<p><b>Largest: \" + result + \"<\/b><\/p>\";\n    };\n})();\n<\/script>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Compare<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/pages\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":12,"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/isthistextinthebible.wordifysites.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}