Read the statement by Michael Teeuw here.
New to building modules. plz help
-
yeh, there is some difficult cors (cross site scripting security) problem
-
@Djninja926 to get the api request to work, I had to add a proxy handler
var urlApi = "https://stats.foldingathome.org/api/donor/Apia_Okorafor"; var proxyUrl = 'https://cors-anywhere.herokuapp.com/' fetch(proxyUrl+urlApi,
-
@sdetweil where do I add the code
var urlApi = "https://stats.foldingathome.org/api/donor/Apia_Okorafor"; var proxyUrl = 'https://cors-anywhere.herokuapp.com/' fetch(proxyUrl+urlApi,
-
@Djninja926 sorry, I was trying different things, forgot that I changed the request function,
back to the original sourcevar urlApi = "https://stats.foldingathome.org/api/donor/Apia_Okorafor" var proxyUrl = 'https://cors-anywhere.herokuapp.com/' // added var retry = true; var dataRequest = new XMLHttpRequest(); dataRequest.open("GET", proxyUrl+urlApi, true); // changed
-
@sdetweil I did all that and this was the output
I think It is working so what do i do know. -
@Djninja926 figure out the data differences from the 1st api used to the new one, and how you have to fix the output format
-
@sdetweil I dont get what you mean
-
@Djninja926 the code u changed had some expected data format back from the service it called.
it used that data format in the code to make the visual part of the outputthe new api (that url ) provides data in a different format.
as an example of the type of thing I am talking about,
1 has a spreadsheet with 4 columns, and 1 has a spreadsheet with 8 columns and none of the column names are the same.
the code expected to find 4 columns with specific names. they aren’t therehow do you reconcile that?
=====> but these apis return json data not excel spreadsheets, it is just an example of the work you need to do
-
@sdetweil how do I make it JSON format
-
@sdetweil or how do I make the module take whatever format the urlApi is