corysimmons/picky.json

Wishlist

corysimmons opened this issue · 16 comments

None of these are important whatsoever, but they'd be awfully neat.

  • It'd be cool if people could share url's like pickyjson.com/aD8mJh would produce a page with the textarea/code already filled out and a particular value highlighted. #15 (comment) To do this we'd probably need to take the page off gh-pages. If the tool got super popular (billions of people using it every minute) then it might cost some money to keep alive. At that point we might throw up a "$5/mo membership" option and let people who are logged in access/create these share url's (teams). I wouldn't want to make any money off this so the cost would directly reflect how much it cost to keep it alive.
  • localStorage caching of the last used JSON
  • Collapse objects/arrays
  • Better perf and/or a higher throttle. When manipulating a URL in <textarea> it is often a valid URL and ends up reloading a bunch of JSON which actually makes my typing halt and causes the site to freeze. It might be nice if we added in some sort of loading animation or notification: "Valid JSON detected at URL. Loading it now..."
  • Better performance and/or adding throttling when adding large JSON into the textarea
  • Make the site also available as a chrome extension?
  • It'd be neat if we fetched endpoints that weren't just JSON. Like images and such. But at that point I guess the scope would stop being about JSON completely.

1 could be pretty simple to do free of charge and entirely client-side. Hosting the site on Surge would allow the use of their 200.html feature which means all urls hit the same file. You can then use a compressed url taken from the path. Not sure how viable the (de)compression of strings on the client side is though.

Ah that'd be cool! Thanks @danreeves

We can't have URL's that contain all the JSON though, so how could we map pickyjson.com/s93Jna to a specific JSON file? <- I'm stupid, hashing works, but for big files (even small JSON like the example) it takes forever to decrypt. Cool idea though!

Although you could do it without Surge right? Just use a query string, get the attribute from that and put it into the page?

The problem would be trying to find a reversible, short hash to represent the JSON.

Theoretically it would be possible by doing:

// Encode
var hash = encodeURIComponent(btoa( JSON.stringify({ "hello": "example" }) ));

// Decode
var decoded = atob(decodeURIComponent(hash));

But that wouldn't create a short enough hash to able to deal with large JSON structures.

One avenue we're thinking of looking at is using firebase. We could possibly have a 'generate link' button which sends of the stringified JSON to firebase with a unique ID.

The user can then use this link to share their JSON with other people for a certain time period before it will be deleted from firebase.

I think this is a great idea. Now the fun part: learning Firebase. :^)

For the throttle, we could change it from 1 seconds to 2 seconds and then also add a loading notification?

Throttle of 2 seconds and loading message here: https://github.com/danjford/picky.json/tree/throttle-loading

@corysimmons the collapsible feature would be quite easy, we would just need a plus / minus to show up on hover next to the relevant attribute which would toggle an attribute which collapses it.

Let me know if you want those other two enhancements merged into the gh-pages branch :P

Merge baby merge! Thank you :D

Have added Better performance and/or adding throttling when adding large JSON into the textarea to the wishlist.

👍

Why the Chrome Extension?

@corysimmons it was suggested on Reddit so I thought it might be interesting to look into :P

I didn't see that comment. Oh well. Sounds good. I'd probably be more likely to use it if it were a Chrome Extension. I just wonder what it'd look like.

I was thinking, for the chrome extension. Mayhe all it would need to be is that on a page load it recognises JSON.

A notification will then appear on the extensions icon. You can then click the extension and it will open pickyjson.com in a new tab with the url pasted and data loaded?

Yeah that seems pretty slick/easy. Make it so number 1