Another post with little script:

And for JSON serialization you might use this page