» JSON parser
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

JSON parser

plugin
Credits: http://james.newtonking.com/projects/json-net.aspx http://sanchtv.com

about

simple json parser plugin with json.net

download

pluginJson.zip
31.08.12 [19:13 UTC] by sanch | 1990 downloads

sebl 05/10/2012 - 10:51

nice plugin, but wouldn't this make it "really" spreadable:

[PluginInfo(Name = "JsonParser", Category = "JSON", Help = "parse json string", Tags = "")]
public class JsonParser : IPluginEvaluate
{
    #region fields & pins
    [Input("JSON", DefaultString = "hello")]
    IDiffSpread<string> FInput;
 
    [Output("Output json")]
    ISpread<JObject> FJOutput;
 
    [Import()]
    ILogger FLogger;
    #endregion fields & pins
    //called when data for any output pin is requested
 
    public void Evaluate(int SpreadMax)
    {
        FJOutput.SliceCount = SpreadMax;
 
        if(FInput.IsChanged )
        {
            FJOutput[0] = JObject.Parse(FInput[0]);
        }
    }
}
sanch 05/10/2012 - 13:53

Yes the json itself is not spreadable , i didn't really needed that feature so i left it that way , but well source is here feel free to make it spredable.

sebl 05/10/2012 - 19:13

yes, i think it's just that few lines above... if someone with json knowledge confirms that working, i can update the contrib.

though it's needed or not, i alwayys try™ to make new nodes asap*

  • asap = as spreadable as possible
sanch 05/10/2012 - 20:14

I think it should work , but the problem will be that you'll have to change the other node to have json input spreadable as well , add a binsyze for the query node otherwise there will be no way to know wich query go with wich json.
Actually an easier way will be to add all the json together with +(string spectral) node with the correct json formatting and query it as a single json , much more easy than dealing with binsyze stuff and at the end you got the same result.
The node for the list is also not spreadable , but could be without to much work , as well a binsyze output will be needed to identify the ouput data with the corresponding query.

Usually when i don't have time, i don't care about doing stuff i don't need , but i still share the result...

herbst 23/02/2013 - 18:28

As alternative to that, fully spreadable:
((json-aselement,)) which parses JSON directly to XElement using the .NET builtin parser.

Of course, with XElement you still have the headache of caring about binsizes and stuff further down the expanding-lots-of-single-things-into-lots-of-spreaded-things road.

sansui 28/03/2014 - 14:50

sanch, hi
I used this plugin very usefully.
but, I have a trouble in parse of using JSON Array node.
{key1 :{key2:value2}, {key3:value3}, {key4:value4} }
this data could parse successfully.
but this data couldn't in case of just only json array except of key.{key2:value2}, {key3:value3}, {key4:value4}
maybe, I think JSON Array node always need path value.

andresc4 16/01/2018 - 00:54

I would like to filter bitcoin price from here
https://api.coinmarketcap.com/v1/ticker/?limit=10
but im not getting how to use this

anonymous user login

Shoutbox

~4d ago

joreg: Workshop on 01 08: Augmented Reality using OpenCV, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-augmented-reality-using-opencv-in-vvvv/

~12d ago

joreg: Workshop on 18 07: Fluid simulations in FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-fluid-simulations-in-fuse/

~12d ago

joreg: Workshop on 17 07: Working with particles in FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-working-with-particles-in-fuse/

~23d ago

joreg: Here's what happened in June in our little univvvverse: https://visualprogramming.net/blog/2024/vvvvhat-happened-in-june-2024/

~25d ago

joreg: We're starting a new beginner tutorial series. Here's Nr. 1: https://visualprogramming.net/blog/2024/new-vvvv-tutorial-circle-pit/

~26d ago

joreg: Registration is open for LINK - the vvvv Summer Camp 24! Full details and signup are here: https://link-summercamp.de/

~26d ago

joreg: Workshop on 11 07: Compute Shader with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-compute-shader-with-fuse/

~1mth ago

joreg: Workshop on 27 06: Rendering Techniques with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-rendering-techniques-with-fuse/

~1mth ago

joreg: Workshop on 20 06: All about Raymarching with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-all-about-raymarching-with-fuse/

~1mth ago

joreg: vvvv gamma 6.5 is out, see changelog: https://thegraybook.vvvv.org/changelog/6.x.html