Hi S,

Are you trying to implement this as a Javascript Macro 
<http://tiddlywiki.com/dev/#JavaScript%20Macros>? Have you looked in the 
develop console to see what error you're actually getting?

I'm currently trying to write a TiddlyWiki plugin that calls an API but 
have had difficulties because the Javascript runs in the browser it is 
subject to the Same Origin Policy and so unless the API you are calling 
supports CORS your requests will be rejected by the browser.

The reason Firefox addons can make such requests is because addons are 
extensions to the browser itself and therefore can have special privileges 
to ignore CORS restrictions that the browser would enforce on normal web 
pages.

TiddlyWiki can be run as a node server and server-side code is not subject 
to CORS restrictions so you can call whatever APIs you want. However there 
are other open source projects designed specifically to be API test beds. 
You might want to look at Swagger UI <http://swagger.io/swagger-ui/>. You 
can test it out using the Swagger Editor <http://editor.swagger.io/#/>.

On Monday, 20 June 2016 15:57:53 UTC+1, S. wrote:
>
> Hi there.
>
> I want to grab information from a RESTful API (for instance this: 
> https://developer.spotify.com/web-api/get-recommendations/ ), which will 
> return XML or JSON, and was thinking TW would be a fine platform to test 
> connections, and perhaps even configure a prettified view of the response.
>
> I'm very rusty in TW development, haven't touched it in years, is there 
> any plugin tutorials, or plugins themselves you can point to as a good 
> start for me to look at?  I've done a bit of googling, but not finding 
> anything yet.
>
> Regards,
> S.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/dcb44944-1f8e-47e6-ab0a-b3aae35aa773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to