Region
I started writing a script that will make chained API calls (with a JSON response) and write the result to a spreadsheet.
What's happening:
As soon as I debug the script code, it works fine, without any serious problems, but as soon as I run it from the spreadsheet itself (from the menu I created), it performs several script steps and produces a: Service Error: Spreadsheet without any other details.
Weirdness
I started to โregisterโ the current stage of the process in a table cell, so that I could track its progress when running the script from the debugger.
The problem is that when I move some "random" fragments, such as:
sheet.getRange("F2").setValue(currentPage);
code tends to break up at different points.
Code example:
You can find the code to reproduce the problem here: http://pastebin.com/HjmSwEYZ
All you have to do is:
1 - Create a new spreadsheet in Google Drive
2 - Hit Tools -> Script Editor
3 - Create a new Script, paste the code and save
4 - Reload the table (F5) so that the user menu "Guild Wars 2 Tracker" now appears
5 - Click the button and click "List All"
Desired Result:
What this code should (if not for this error) :
1 - Fulfill the request at this URL: http://www.gw2spidy.com/api/v0.9/json/items/all/1 (which will return the first page of Guild Wars 2 itens)
2 - Iterate over each page, parse json and write return values โโto table
Denial of responsibility:
Sorry for all the "Journal" posts on the sheet. It was a desperate attempt to track my progress, I know that I should not do this.
Thank you in advance
Update 1:
After creating another table and pasting pastebin code into my own script project, I can run it for interaction, but thatโs all. This time he raised another error: We're sorry, a server error occurred. Please wait a bit and try again. We're sorry, a server error occurred. Please wait a bit and try again.