I’m trying to use the Wordnik Temboo Choreo to call a random word and make it follow the mouse. Eventually I’d like to evolve this sketch to call many random words to follow the mouse – I thought that would be a cool interactive “hello, world!” to put on my homepage, since I refer to myself as a Communication Artist.
Some of the obstacles I’ve run into:
- I was having trouble saving a .json file. Temboo’s example tutorial for parsing JSON files in Processing calls for you to use a text editor and save the response code as a JSON file…when I save a file as plain text (.txt) from TextEdit and alter the extension to .json manually (that’s how all of the internet forums seem suggest saving .json files without a special text editor, such as Notepadd++ which only works for Windows users) – my computer recognizes the file as a Max patcher: I saved a few versions of this file, selecting different file extensions as save options from the drop down menu. Despite the fact that they show up as Max patcher files, one of them ended up working to call the JSON file in my sketch. The most frustrating aspect of this particular obstacle was that I’m pretty sure I’m going to have to pull data dynamically to accomplish what I want to do (i.e. I don’t want to save and call the same JSON file every time I run my sketch), but Temboo doesn’t offer an example tutorial for how to parse JSON data dynamically.
- In order to parse the JSON data dynamically, I need to figure out how to save the response I get from the Choreo as a JSON file within the sketch, and then, in a different function of the sketch, load and parse the JSON data. I’m having trouble translating how to do this in my own sketch…
- UPDATE: Temboo does offer a JSON parsing Choreo which appears to be one workaround for the challenges I was running into.
- After including the JSON parsing Choreo in my Wordnik Choreo sketch, I was able to get a random word to follow the mouse, but as you can see, it’s not quite displaying how I want yet…
- Next step is going to be to use the JSON & XML parsing techniques we went over in class 9/16 to rewrite my sketch without the JSON parsing choreo. I think that might solve the extra characters I’m seeing when I display the random word.