JSONovich emerges
JSONovich has now emerged from the Mozilla Add-ons sandbox and is available to the masses: http://addons.mozilla.org/en-US/firefox/addon/10122.
JSONovich update
JSONovich is now up to version 0.6. Recent revisions have added the following functionality:
- Reads in JSON and converts to UTF-8 for some naive Unicode handling
- Wraps long lines at the right edge of the window
- Adds a check to see if a native JSON parsing library is already loaded (as will be the case in Firefox 3.1). Uses that library if so, otherwise loads the module included in JSONovich.
- Handles JSON syntax errors more gracefully. Used to eat bad data and display nothing, but syntax errors (from the JSON parser) are now surfaced.
I've also tossed the source up on code.google.com for version control.
In the meantime, those of you who are using JSONovich can help increase its exposure by heading over to its entry at addons.mozilla.org, logging in, downloading, rating, and reviewing the extension. Reviews and ratings help get extensions "promoted" from the sandbox to the public site, which provides the ability for automatic updates when new versions of the extension are released.
JSONovich in the sandbox
JSONovich is now in the "sandbox" over at addons.mozilla.org, where it will remain until it's been tested a bit more, and rated and reviewed by users. Until that point, it will be marked as "experimental" and will require users to login before they can download it. If any of you would like to give JSONovich a quick spin and rate/review it over at the Mozilla add-ons site, that would be solid. Once it's gotten a few reviews and I'm more comfortable about it working cross-platform and cross-version, I'll nominate it to be promoted.
Here's where it lives: https://addons.mozilla.org/en-US/firefox/addon/10122
Much obliged, folks. And thanks to those of you who have already downloaded it, installed it, tested it, left comments, or some combination thereof.
Introducing JSONovich
JSONovich is a Firefox extension that pretty-prints and colorizes JSON.
Feedback is welcome.
JSON and the Blarghonauts, or, Firefox and Pretty-Printing FAIL
There must be a better way of viewing pretty-printed JSON from Firefox than this. (EDIT: Hail, JSONovich!)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/usr/bin/env python # ~/bin/jsonhandler.py # Take some JSON from a file or stdin, format it, output to a tempfile, # open in EDITOR from __future__ import with_statement import os import sys import simplejson import tempfile EDITOR = "/usr/bin/gedit" if __name__ == "__main__": if len(sys.argv) == 2: # if invoked as jsonhandler.py {FILE} json = open(sys.argv[1]) else: # if JSON is piped in (e.g., from Firefox, # or cat {FILE} | jsonhandler.py) json = sys.stdin json = simplejson.load(json) # the with_statement is kind of gratuitous but I like it with open(tempfile.mktemp('.json'), 'w') as jsonfile: simplejson.dump(json, jsonfile, indent=4) # all of that and gedit doesn't even highlight JSON # I have emacs highlighting JSON but this generates a "stdin is not # a tty" error, so EDITOR is not set to emacs # xemacs works a little better, but I need to click: # "Options > Syntax Highlighting > In this buffer" every time, despite # saving to custom.el, so EDITOR is not set to xemacs # Very annoying! os.system("%s %s" % (EDITOR, jsonfile.name)) |
And then I set ~/bin/jsonhandler.py as the action for application/json in Edit | Preferences | Applications.
Yuck. Help?
