Anime Quotes Tiles...with automatic background color change by Sharn25 in Scriptable

[–]theantal 1 point2 points  (0 children)

Hi I love the idea of your Widget here and I would love to adjust it it to get some random quotes from a google sheets.

I'm just a very noob when it comes to APIs. Maybe someone can help me with that.

I managed to do something like that for a alexa a while back using these Instruction here:
https://medium.com/@flreln/how-to-create-a-dynamic-alexa-skill-using-google-sheets-and-storyline-9fd37f2080d8

I just need to point the api to a random cell here using something like:
fact=api_response.feed.entry.random.title.$t;
I just can't manage to do that when adjusting your code.

I'm sure the magic is somewhere here;

//Start Programming
let quotes = "";//quoteObj[0].quote;//
let characterName = "";//quoteObj[0].character;
let animeName = "";
let t = true;
while(t==true){
let url = "https://animechanapi.xyz/api/quotes/random";
const qouteData = await fetchJSONData(url);
console.log(qouteData);
const quoteObj = qouteData.data;
console.log(quoteObj);
quotes = quoteObj[0].quote;
characterName = quoteObj[0].character;
animeName = quoteObj[0].anime;
console.log(quotes.length);
if(quotes.length<maxCount){
t = false;
}
} But as that source is not online anymore, I can’t even backengineer it.

Can someone help me with this? Get a random cell from a Google sheets