Strong's API recommendation

363 views
Skip to first unread message

johnmarsing

unread,
Jul 9, 2015, 3:38:00 PM7/9/15
to openscr...@googlegroups.com
Hello,

For my website, www.MyHebrewBible.com, I'm looking for a resource to allow my users to lookup Strong's numbers in an Ajax sort of way.  Currently what I do is dynamically create a link to Blue Letter Bible which is better than nothing, but I would prefer to do get this kind of information with a service call and have my users stay on my site.

Ideally I would want to create my own Strong's lookup using a database that's populated from https://github.com/openscriptures/HebrewLexicon, but I'm not yet ready for that.

Thank
John Marsing
Twitter: @JohnMarsing
web master / owner of www.MyHebrewBible.com


Nigel Chapman

unread,
Jul 10, 2015, 5:42:06 PM7/10/15
to openscr...@googlegroups.com
Hi John, 

If you can reduce the XML data to just an associative array (or find one online, something mapping number to definition) this becomes very simple. 

//  In say PHP:

$defs = [ 
    1 => "The definition",
    2 => "The next definition",
    // ... Add another ~5000? of those, which isn't all that much for a script to handle. 
];

//  Or you could load that from a JSON file, say. Then just get the Strongs number from the GET or POST request and do the lookup. 

$n = isset($_REQUEST['n']) ? $_REQUEST['n'] : '';  

return isset($defs[$n]) ? $defs[$n] : '';


//  And that's it. You can rewrite those ternary operators as simple if/thens if that's clearer. 

//  I'm assuming you can do the AJAX request yourself and just need a server-side script to make the calls to. 

//  However: This dataset is sufficiently small that you could put it straight into JavaScript and forget AJAX at all. 

Nigel. 
Reply all
Reply to author
Forward
0 new messages