Open TfTHacker opened 3 years ago
Something is broken with the URL, I think.
I get a net::ERR_NAME_NOT_RESOLVED
error in the console and manually opening https://cors-anywhere.herokuapp.com/https://stoic-quotes.com/api/quote
also results in a 404.
https://stoic-quotes.com/api/quote
itself does work and returns a JSON with the quote and author but if I delete the cors-anywhere part of the URL and try the SB just with the stoic-quote.com URL, I get a net::ERR_FAILED
error.
✂️ Copy of your #42SmartBlock from Roam
response = JSON.parse(response); roam42.smartBlocks.activeWorkflow.vars['stoic-author'] = response.author; roam42.smartBlocks.activeWorkflow.vars['stoic-quote'] = response.text; return '';```%><%NOBLOCKOUTPUT%>
📋 Describe the SmartBlock
Copies a quote to your graph from 'https://stoic-quotes.com/api/quote. It also demonstrates how to use the GET command and JavaScript together to pass variables around
📷 Screenshot of your #42SmartBlock workflow/template from Roam
💡 Additional Info
The quotes API has to be routed through a gateway due to CORS issues. Sometimes this is very slow and may cause the SmartBlock to timeout. This is not an issue with SmartBlocks, but rather the nature of remote web service calls.