How to get the number of verses in a given chapter.

Page 1 of 1 (9 items)
This post has 8 Replies | 2 Followers

Posts 6
savedByGrace | Forum Activity | Posted: Tue, May 27 2014 4:44 PM

Hi,

I am experimenting with calling some of the Biblia APIs and I cannot find a good way to figure out how many verses there are in a given chapter. The best way I can figure out to do this is to call something like http://api.biblia.com/v1/bible/content/LEB.txt.txt?passage=John3&callback=myCallbackFunction&style=oneVersePerLine and parse the response to see how many verses there are.

Is there a better way to do this?

Thanks, John

Posts 9947
George Somsel | Forum Activity | Replied: Tue, May 27 2014 6:03 PM

John Yuhan:

Hi,

I am experimenting with calling some of the Biblia APIs and I cannot find a good way to figure out how many verses there are in a given chapter. The best way I can figure out to do this is to call something like http://api.biblia.com/v1/bible/content/LEB.txt.txt?passage=John3&callback=myCallbackFunction&style=oneVersePerLine and parse the response to see how many verses there are.

Is there a better way to do this?

Thanks, John

You could try reading it. 

george
gfsomsel

יְמֵי־שְׁנוֹתֵינוּ בָהֶם שִׁבְעִים שָׁנָה וְאִם בִּגְבוּרֹת שְׁמוֹנִים שָׁנָה וְרָהְבָּם עָמָל וָאָוֶן

Posts 6
savedByGrace | Forum Activity | Replied: Wed, May 28 2014 9:58 PM

Thanks for the response!

Could you explain a little more? Read what exactly? The response of http://api.biblia.com/v1/bible/content/LEB.txt.txt?passage=John3&callback=myCallbackFunction&style=oneVersePerLine ?

Posts 18860
Rosie Perera | Forum Activity | Replied: Wed, May 28 2014 10:40 PM

He's George, our resident forum curmudgeon. He's being snarky. He means read the chapter, and when you get to the end you'll know how many verses are in it.

I don't know the Biblia API at all, so I can't help you.

BTW, George, did you read that a new study shows curmudgeons have a higher chance of developing dementia? It's not too late. They say you can work on not being cynical and perhaps defend yourself against this fate. But you're not even 39 yet, so you probably have a long time before you have to worry about it anyway...

Posts 10555
Forum MVP
NB.Mick | Forum Activity | Replied: Thu, May 29 2014 4:07 AM

John Yuhan:

I am experimenting with calling some of the Biblia APIs and I cannot find a good way to figure out how many verses there are in a given chapter. The best way I can figure out to do this is to call something like http://api.biblia.com/v1/bible/content/LEB.txt.txt?passage=John3&callback=myCallbackFunction&style=oneVersePerLine and parse the response to see how many verses there are.

Is there a better way to do this?

John, unfortunately I know nothing of the API. But if Logos' code works anything like consistent, it may be worth checking the result if you call the chapter with a verse reference like 200. Usually Logos applications will return the last verse of a chapter (instead of an error code or a verse from a subsequent chapter) if your reference goes beyond the bounds.

(200 is just an arbitrary round number larger than the verse numbers in Ps 119, the longest chapter in bibles, and smaller than 255 just in case they use some hex conversion internally and calling 256 or more behaves differently)

One other hint: there's a special forum just for the API - cross-posting there might alert some API users or even developers.   

Running Logos 8 latest beta version on Win 10

Posts 13392
Mark Barnes | Forum Activity | Replied: Thu, May 29 2014 4:43 AM

John Yuhan:
I am experimenting with calling some of the Biblia APIs and I cannot find a good way to figure out how many verses there are in a given chapter.

AFAIK, you can't do this in Biblia (the 'parse' service ought to do it, but it doesn't). But you can use the ESV API to do it. Look for the queryInfo service. Bear in mind, though, that the number of verses per chapter does differ occasionally from version to version.

Posts 6
savedByGrace | Forum Activity | Replied: Thu, May 29 2014 9:13 PM

Thanks! I am new here I genuinely could not figure out if he was being snarky or I was just missing something obvious :-). Thanks again for your help!

Posts 6
savedByGrace | Forum Activity | Replied: Thu, May 29 2014 9:13 PM

Thanks! I will try that.

Posts 6
savedByGrace | Forum Activity | Replied: Thu, May 29 2014 9:14 PM

Thanks you!

Page 1 of 1 (9 items) | RSS