Librivox API does not work with JQuery $.getJSON()

Post your questions & get help from friendly LibriVoxers
Post Reply
pkosenko
Posts: 21
Joined: December 6th, 2013, 3:34 pm
Location: Santa Monica, California, USA
Contact:

Post by pkosenko » December 8th, 2013, 5:38 pm

It seems impossible to get the Librivox API to work with $.getJSON() remote calls. If JSONP is not functioning to allow remote queries of the Librivox data base that can return data, then I can't create an interface in Drupal that will do an Ajax query of the Librivox database from another site.

$getJSON() always returns and error. I have tried this any variety of ways, introducing a callback to the GET URL, for example, but it always returns error.

var LibrivoxAPI = "https://librivox.org/api/feed/audiobooks/";
data = {
// this is data attached to the URL as a GET Query string
// JSONP callback CANNOT be sent in the data object
format: "jsonp",
author: "Melville"
};
$.getJSON(LibrivoxAPI, data, function() { alert("success");})
.success(function () { alert("second success"); })
.error(function () { alert("error"); })
.complete(function () { alert("complete"); });


This may be due to some quirk in the implementation of JSONP?

There is NO documentation to speak of the Librivox API, and none whatsoever about how to get JSONP data from a remote URL.

Any help from the Librivox programmers?

There seems to be no Librivox program to DOCUMENT the Librivox API . . . or at least document it adequately beyond a bare "list" without explanations.

RuthieG
Posts: 22040
Joined: April 17th, 2008, 8:41 am
Location: Kent, England
Contact:

Post by RuthieG » December 8th, 2013, 11:46 pm

I have copied your post to the API discussion thread, which I believe is being monitored by the development team.

Ruth
My LV catalogue page | RuthieG's CataBlog of recordings | Tweet: @RuthGolding

pkosenko
Posts: 21
Joined: December 6th, 2013, 3:34 pm
Location: Santa Monica, California, USA
Contact:

Post by pkosenko » December 9th, 2013, 8:08 pm

Thanks. I'll bookmark that forum. I'm new here.

Post Reply