Urban Dictionary API

I wrote a very simple (in terms of JavaScript code) urban dictionary random word fetcher in AMLT.

The js code looks like this:

let response = JSON.parse(getHttpResponse("https://api.urbandictionary.com/v0/random"));
MM.AddMessage(response.list[0].word+"\n\n"+response.list[0].definition,10000);Code language: JavaScript (javascript)

“This is very simple!” I heard your mind. Yes, the heavy lifting part of this code resides in AMLT’s C# side(which is not open source). For example, getHttpResponse is a custom function I implemented in C# to give AMLT the ability to send GET requests and receive response from a cloud server. Since JINT itself has no built-in method to send GET and POST requests. (AMLT is not a standard browser, the JS engine of AMLT is less than 2MB!)


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *