Jump to content
UBot Underground

[FREE plugin] JsonPath Parser Plugin


Recommended Posts

Easily Parse Json Outputs and Get The Data You Need Fast


Plugin Name :


JsonPath plugin


 


Plugin Desc :


a jsonpath integration – Json Output parser that is the equivalent to Xpath but for Json Outputs


 


A tutorial On how to build JsonPath Expressions


Click Here


 


Download For Free


(subscribe to my list to get new plugins)


 


if you want to download without subscribing and you wish not to receive the latest juicy free ubot plugins


when i release them , then use the link below to download the plugin


click here


  • Like 8
Link to post
Share on other sites

Amazing Aymen! Not sure how you have enough time in the day to do everything -- but as always, thanks for the contributions!!   :)

no biggie i put this together in 30 min , had to use it in a ubot prototype!

Link to post
Share on other sites
  • 2 weeks later...

Hello Aymen,

 

I'm playing around with the plugin at the moment.

But I'm not able to use all the examples from the site:

http://goessner.net/articles/JsonPath/

 

I'm getting errors with:

$.store.*
Cannot convert Array to String
 
 
$.store..price
Cannot convert Float to String
 
 
$..book[?(@.isbn)]
Just an empty response
 
 
 
Do I have to use a different expression format with the plugin? Or what am I doing wrong here?
 
 
Example Code:
set(#test"\{ \"store\": \{
    \"book\": [ 
      \{ \"category\": \"reference\",
        \"author\": \"Nigel Rees\",
        \"title\": \"Sayings of the Century\",
        \"price\": 8.95
      \},
      \{ \"category\": \"fiction\",
        \"author\": \"Evelyn Waugh\",
        \"title\": \"Sword of Honour\",
        \"price\": 12.99
      \},
      \{ \"category\": \"fiction\",
        \"author\": \"Herman Melville\",
        \"title\": \"Moby Dick\",
        \"isbn\": \"0-553-21311-3\",
        \"price\": 8.99
      \},
      \{ \"category\": \"fiction\",
        \"author\": \"J. R. R. Tolkien\",
        \"title\": \"The Lord of the Rings\",
        \"isbn\": \"0-395-19395-8\",
        \"price\": 22.99
      \}
    ],
    \"bicycle\": \{
      \"color\": \"red\",
      \"price\": 19.95
    \}
  \}
\}""Global")
set(#test2$plugin function("JSONpath.dll""$JSONpath parser"#test"$..book[?(@.isbn)]"), "Global")
alert(#test2)
set(#test3$plugin function("JSONpath.dll""$JSONpath parser"#test"$.store..price"), "Global")
alert(#test3)
set(#test4$plugin function("JSONpath.dll""$JSONpath parser"#test"$.store.*"), "Global")
alert(#test4)
Link to post
Share on other sites

 

Hello Aymen,

 

I'm playing around with the plugin at the moment.

But I'm not able to use all the examples from the site:

http://goessner.net/articles/JsonPath/

 

I'm getting errors with:

$.store.*
Cannot convert Array to String
 
 
$.store..price
Cannot convert Float to String
 
 
$..book[?(@.isbn)]
Just an empty response
 
 
 
Do I have to use a different expression format with the plugin? Or what am I doing wrong here?
 
 
Example Code:
set(#test"\{ \"store\": \{

    \"book\": [ 

      \{ \"category\": \"reference\",

        \"author\": \"Nigel Rees\",

        \"title\": \"Sayings of the Century\",

        \"price\": 8.95

      \},

      \{ \"category\": \"fiction\",

        \"author\": \"Evelyn Waugh\",

        \"title\": \"Sword of Honour\",

        \"price\": 12.99

      \},

      \{ \"category\": \"fiction\",

        \"author\": \"Herman Melville\",

        \"title\": \"Moby Dick\",

        \"isbn\": \"0-553-21311-3\",

        \"price\": 8.99

      \},

      \{ \"category\": \"fiction\",

        \"author\": \"J. R. R. Tolkien\",

        \"title\": \"The Lord of the Rings\",

        \"isbn\": \"0-395-19395-8\",

        \"price\": 22.99

      \}

    ],

    \"bicycle\": \{

      \"color\": \"red\",

      \"price\": 19.95

    \}

  \}

\}""Global")

set(#test2$plugin function("JSONpath.dll""$JSONpath parser"#test"$..book[?(@.isbn)]"), "Global")

alert(#test2)

set(#test3$plugin function("JSONpath.dll""$JSONpath parser"#test"$.store..price"), "Global")

alert(#test3)

set(#test4$plugin function("JSONpath.dll""$JSONpath parser"#test"$.store.*"), "Global")

alert(#test4)

 

Would be great if someone could test that as well?

Might be that I'm doing something wrong?

 

Dan

Link to post
Share on other sites

Would be great if someone could test that as well?

Might be that I'm doing something wrong?

 

Dan

i didn't have a chance to test everything yet ,when i get some time I'll run different scenarios and see if it has problems!

Link to post
Share on other sites

hey

there was a bug with digits not being converted properly to string , that was fixed rather than that the only thing that didn't work for me (after i fixed the bug) is filtering !

Which was a general issue with the class library written by those who made JsonPath!

I'll try to fix it myself when i get some time off!

Link to post
Share on other sites
  • 1 month later...

Update :

-Cannot convert Array to String bug fixed

-Cannot convert Float to String bug fixed

 

Use the same download link in the thread!

Link to post
Share on other sites
  • 7 months later...

I am trying to do an expression like the above examples of dan's

 

"$..book[?(@.isbn)]" and getting nothing.

 

that expression is extremely useful and would be great if this could be fixed/added ASAP!

 

Thanks

  • Like 1
Link to post
Share on other sites
  • 1 month later...

I am trying to do an expression like the above examples of dan's

 

"$..book[?(@.isbn)]" and getting nothing.

 

that expression is extremely useful and would be great if this could be fixed/added ASAP!

 

Thanks

 

Great plugin, but the expressions aren't working. Maybe Aymen could add it.

Link to post
Share on other sites
  • 1 month later...
  • 3 weeks later...
  • 4 months later...

Update :

-Cannot convert Array to String bug fixed

-Cannot convert Float to String bug fixed

 

Use the same download link in the thread!

 

The date on this post is Jun 02, 2014, but the date on the plugin in the download link is Apr 08, 2014... so the dl link has not been updated I dont think... I was trying to get filtering working and I cant, so trying to see if I had the newest version where you said that had been fixed, and I cant figure out if I have the fixed one or the broken one. Any help?

 

Thanks

Link to post
Share on other sites
  • 6 months later...

Plugin v1.0.0.1 not working for me.... get an object error :(

set(#json, "\{
     \"firstName\": \"John\",
     \"lastName\" : \"Smith\",
     \"age\"      : 25,
     \"address\"  :
     \{
         \"streetAddress\": \"21 2nd Street\",
         \"city\"         : \"New York\",
         \"state\"        : \"NY\",
         \"postalCode\"   : \"10021\"
     \},
     \"phoneNumber\":
     [
         \{
           \"type\"  : \"home\",
           \"number\": \"212 555-1234\"
         \},
         \{
           \"type\"  : \"fax\",
           \"number\": \"646 555-4567\"
         \}
     ]
 \}", "Global")

alert($plugin function("JSONpath.dll", "$JSONpath parser", #json, "$..type"))

Will open a fresh file and try again tomorrow!

 

Will be cool if this works, and would save a big headache dealing with JSON.

 

i notice no 'path exists' function, like in your xpath plugin... Maybe am doing something wrong?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...