|
View your shopping cart.
Recent topics
Recent Comments |
JSON To Structure (Composition by smokris)
Converts a JSON string input into a Structure. Useful in conjunction with the Kineme FileTools "String With URL" patch, to produce an alternative to the built-in XML Importer patch. An example composition is attached, using this patch to parse the results of a Yahoo Search API query. More like this
|
Sorry to be the bearer of sad tidings about something that is pretty brilliant - but this is provoking a JavaScript related GF Log message
when the search term has a space - only single word search terms not multiple word strings. a multiple search string will not obtain a search result at all.
The error clears upon presenting a only a single word search term or even character, so not especially serious.
Update - entering terms as say ford/motors providing an escape character by means of the slash character makes this work without a JS error.
Just been tinkering with the Demo comp and obviously enough one can add in additional search boxes [Arguments] to contain discrete terms that build to be the total string. - does work.
I'm on Leopard. Put the JSON_To_Structure.qtz into …/Library/Graphics/Quartz Composer Patches/
When I open JSON_To_Structure_Demo comp it doesn't find the JSON_To_Structure patch. ie Console Error. Manually placing the JSON_To_Structure patch into the comp and joining it to Kineme String With URL and ResultSet patches generates a structure but the same image is being repeated 10 times.
The text gives the different URLs though.
This works on .5 you say ? looks like it isn't reading the JSON output correctly at all apart from the text listing, it just isn't leveraging the underlying .6.2 specific JSON and structure stuff - pity. probably could be 'reverse engineered' to do the same, although virtual macro wise isn't that also .6.x specific? difficult to tell from your mini picture :-) so I've attached my results for your comparison , same misspelt beafheart •~ I do get a range of different text and associated image results, but then I'm running .6.x, so no surprise really. do you also get a js error when presenting a spaced search term, like manchester united whereas manchester/united obtains no error and gets results [by the looks of things , just the textual search results]?
I'm in the most recent 10.6 seed right now, and it's working fine. I had to open the "JSON_To_Structure.qtz", let QC install it as a Virtual Macro (it prompts for this), then open the demo qtz.
This is excellent. So simple and elegant.
I'll try this in 10.5 too. I've had probs with Virtual Macro's from 10.6 not working correctly in 10.5 before...
Are you saying that multiple word search terms like 'pancake day' would work without needing to enter them as pancake/day, as I'm having to do right now?
Oh no, I didn't mean to infer that. The slash is needed for me as well, when I use multiple words.
Hm, there are a few different issues at play here:
Image Importerdoesn't work inside Iterators in 10.5). The Clip itself doesn't require 10.6.Thanks for clearing that up (10.6), smokris.
"Beefheart" gave me an image that was too Lame to post x10 (the heart of a beef)!
Thanks for listening and responding .
Updated: this clip might actually run on 10.5 now --- apparently 10.5's Javascript patch doesn't include the
JSONclass (while 10.6's does). I added a workaround so that it works on both.Thankyou very much for being in the google index for quartz composer JSON - you saved me a lot of time :D