Browser requests to getbible.net fail now due to CORS issue #9

Open
opened 2023-09-26 07:59:45 +00:00 by rene · 9 comments

Hi @Llewellyn,

There seems to be have been a recent change in the server settings of getbible.net. Requests like await fetch('https://getbible.net/v2/checksum.json') now fail when executed from other origins. This has broken the preview of my Bible reference tagger blinx.js, as can be seen on this page.

Would you have time to look into this?

Thanks!

Hi @Llewellyn, There seems to be have been a recent change in the server settings of getbible.net. Requests like `await fetch('https://getbible.net/v2/checksum.json')` now fail when executed from other origins. This has broken the preview of my Bible reference tagger [blinx.js](https://github.com/renehamburger/blinx.js), as can be seen [on this page](https://kurs.bibel-fuer-alle.net/mod/page/view.php?id=122#h:2). Would you have time to look into this? Thanks!
Owner

I am looking at this now... not sure why, as it worked.

I am looking at this now... not sure why, as it worked.
Owner

Hmmm I see this issue. Our domain has changed: https://api.getbible.net/v2/checksum.json is the new path to the API.

Hmmm I see this issue. Our domain has changed: `https://api.getbible.net/v2/checksum.json` is the new path to the API.
Owner

Let me know if this resolves your issue. You will see that getBible.net has been completely build over, and has a whole new application, that is by far more powerful than the one we had before.

I mean look at: https://getbible.net/kjv/Revelation/3/5

Our new application (Joomla Extension) has URL and search, with tags, and OpenAI abilities.

Let me know if this resolves your issue. You will see that getBible.net has been completely build over, and has a whole new application, that is by far more powerful than the one we had before. I mean look at: https://getbible.net/kjv/Revelation/3/5 Our new application (Joomla Extension) has URL and search, with tags, and OpenAI abilities.
Owner

More info on the API and what we are doing go to: https://getbible.net/docs

More info on the API and what we are doing go to: https://getbible.net/docs
Author

Thanks for the quick response, @Llewellyn! Adjusting the domain does the trick!

How can I find out more about the upcoming "GROUPED VERSE SELECTION" feature?

Thanks for the quick response, @Llewellyn! Adjusting the domain does the trick! How can I find out more about the upcoming "GROUPED VERSE SELECTION" feature?
Owner

That is still under development, I am trying to move that out into a lone standing application, and not make it directly part of the Joomla application as before.

I have been looking at a number of ways to achieve this, and have not yet made up my mind.

I had to move the due date to 1st of December 2023 because of this, yet I am really working hard to get it done sooner.

Do you know JQ? Using the existing API files, I was think of using JQ to serve the Grouped Verse Selection, which would mean chaining a number of technologies. I have not yet come to a final position on this, yet what I hope to achieve is a much faster, stable and long term solution that stand independent from Joomla.

That is still under development, I am trying to move that out into a lone standing application, and not make it directly part of the Joomla application as before. I have been looking at a number of ways to achieve this, and have not yet made up my mind. I had to move the due date to 1st of December 2023 because of this, yet I am really working hard to get it done sooner. Do you know [JQ](https://github.com/jqlang/jq)? Using the existing API files, I was think of using JQ to serve the Grouped Verse Selection, which would mean chaining a number of technologies. I have not yet come to a final position on this, yet what I hope to achieve is a much faster, stable and long term solution that stand independent from Joomla.
Owner

What would you use if you had to build this based of the existing API json files?

What would you use if you had to build this based of the existing API json files?
Owner

Here is a playground for jq: https://jqplay.org/

Here is a playground for jq: https://jqplay.org/
Owner

The new QUERY-API for verse queries are located at:

https://query.getbible.net/v2/

The design allows for one translation at a time:

https://query.getbible.net/v2/[abriviation]

But with multiple scripture references:

https://query.getbible.net/v2/[abriviation]/[ref];[ref];[ref]

The book name (or number) must be in each reference.

Please also note that the Result of the return set has changed, and is now more aligned with version 2 format.

https://query.getbible.net/v2/kjv/2 Peter 1:3-4

Result:

{
  "kjv_61_1": {
    "translation": "King James Version",
    "abbreviation": "kjv",
    "lang": "en",
    "language": "English",
    "direction": "LTR",
    "encoding": "UTF-8",
    "book_nr": 61,
    "book_name": "2 Peter",
    "chapter": 1,
    "name": "2 Peter 1",
    "verses": [
      {
        "chapter": 1,
        "verse": 3,
        "name": "2 Peter 1:3",
        "text": "According as his divine power hath given unto us all things that pertain unto life and godliness, through the knowledge of him that hath called us to glory and virtue:"
      },
      {
        "chapter": 1,
        "verse": 4,
        "name": "2 Peter 1:4",
        "text": "Whereby are given unto us exceeding great and precious promises: that by these ye might be partakers of the divine nature, having escaped the corruption that is in the world through lust."
      }
    ]
  }
}

https://query.getbible.net/v2/kjv/2 Peter 1:3-4;James 4:6

Result:

{
  "kjv_61_1": {
    "translation": "King James Version",
    "abbreviation": "kjv",
    "lang": "en",
    "language": "English",
    "direction": "LTR",
    "encoding": "UTF-8",
    "book_nr": 61,
    "book_name": "2 Peter",
    "chapter": 1,
    "name": "2 Peter 1",
    "verses": [
      {
        "chapter": 1,
        "verse": 3,
        "name": "2 Peter 1:3",
        "text": "According as his divine power hath given unto us all things that pertain unto life and godliness, through the knowledge of him that hath called us to glory and virtue:"
      },
      {
        "chapter": 1,
        "verse": 4,
        "name": "2 Peter 1:4",
        "text": "Whereby are given unto us exceeding great and precious promises: that by these ye might be partakers of the divine nature, having escaped the corruption that is in the world through lust."
      }
    ]
  },
  "kjv_59_4": {
    "translation": "King James Version",
    "abbreviation": "kjv",
    "lang": "en",
    "language": "English",
    "direction": "LTR",
    "encoding": "UTF-8",
    "book_nr": 59,
    "book_name": "James",
    "chapter": 4,
    "name": "James 4",
    "verses": [
      {
        "chapter": 4,
        "verse": 6,
        "name": "James 4:6",
        "text": "But he giveth more grace. Wherefore he saith, God resisteth the proud, but giveth grace unto the humble."
      }
    ]
  }
}

Please use the default API for chapter calls, as this API is really only for verse queries, thanks!

The new QUERY-API for verse queries are located at: ``` https://query.getbible.net/v2/ ``` The design allows for one translation at a time: ``` https://query.getbible.net/v2/[abriviation] ``` But with multiple scripture references: ``` https://query.getbible.net/v2/[abriviation]/[ref];[ref];[ref] ``` The book name (or number) must be in each reference. Please also note that the Result of the return set has changed, and is now more aligned with version 2 format. ``` https://query.getbible.net/v2/kjv/2 Peter 1:3-4 ``` Result: ``` { "kjv_61_1": { "translation": "King James Version", "abbreviation": "kjv", "lang": "en", "language": "English", "direction": "LTR", "encoding": "UTF-8", "book_nr": 61, "book_name": "2 Peter", "chapter": 1, "name": "2 Peter 1", "verses": [ { "chapter": 1, "verse": 3, "name": "2 Peter 1:3", "text": "According as his divine power hath given unto us all things that pertain unto life and godliness, through the knowledge of him that hath called us to glory and virtue:" }, { "chapter": 1, "verse": 4, "name": "2 Peter 1:4", "text": "Whereby are given unto us exceeding great and precious promises: that by these ye might be partakers of the divine nature, having escaped the corruption that is in the world through lust." } ] } } ``` ``` https://query.getbible.net/v2/kjv/2 Peter 1:3-4;James 4:6 ``` Result: ``` { "kjv_61_1": { "translation": "King James Version", "abbreviation": "kjv", "lang": "en", "language": "English", "direction": "LTR", "encoding": "UTF-8", "book_nr": 61, "book_name": "2 Peter", "chapter": 1, "name": "2 Peter 1", "verses": [ { "chapter": 1, "verse": 3, "name": "2 Peter 1:3", "text": "According as his divine power hath given unto us all things that pertain unto life and godliness, through the knowledge of him that hath called us to glory and virtue:" }, { "chapter": 1, "verse": 4, "name": "2 Peter 1:4", "text": "Whereby are given unto us exceeding great and precious promises: that by these ye might be partakers of the divine nature, having escaped the corruption that is in the world through lust." } ] }, "kjv_59_4": { "translation": "King James Version", "abbreviation": "kjv", "lang": "en", "language": "English", "direction": "LTR", "encoding": "UTF-8", "book_nr": 59, "book_name": "James", "chapter": 4, "name": "James 4", "verses": [ { "chapter": 4, "verse": 6, "name": "James 4:6", "text": "But he giveth more grace. Wherefore he saith, God resisteth the proud, but giveth grace unto the humble." } ] } } ``` Please use the default API for chapter calls, as this API is really only for verse queries, thanks!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: getBible/support#9
No description provided.