picky.json icon indicating copy to clipboard operation
picky.json copied to clipboard

Wishlist

Open corysimmons opened this issue 9 years ago • 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. https://github.com/corysimmons/picky.json/issues/15#issuecomment-178222028 ~~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.~~
  • [x] localStorage caching of the last used JSON
  • [x] Collapse objects/arrays
  • [x] 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..."
  • [x] Better performance and/or adding throttling when adding large JSON into the textarea
  • [x] 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.

corysimmons avatar Feb 01 '16 19:02 corysimmons

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.

danreeves avatar Feb 01 '16 21:02 danreeves

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!

corysimmons avatar Feb 01 '16 21:02 corysimmons

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.

danjford avatar Feb 01 '16 21:02 danjford

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.

danjford avatar Feb 01 '16 22:02 danjford

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

corysimmons avatar Feb 01 '16 22:02 corysimmons

localStorage code is here https://github.com/danjford/picky.json/tree/local-storage

danjford avatar Feb 02 '16 14:02 danjford

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

danjford avatar Feb 02 '16 14:02 danjford

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

danjford avatar Feb 02 '16 14:02 danjford

@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

danjford avatar Feb 02 '16 14:02 danjford

Merge baby merge! Thank you :D

corysimmons avatar Feb 02 '16 16:02 corysimmons

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

danjford avatar Feb 03 '16 08:02 danjford

:+1:

Why the Chrome Extension?

corysimmons avatar Feb 03 '16 08:02 corysimmons

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

danjford avatar Feb 03 '16 09:02 danjford

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.

corysimmons avatar Feb 03 '16 09:02 corysimmons

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?

danjford avatar Feb 05 '16 17:02 danjford

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

corysimmons avatar Feb 05 '16 17:02 corysimmons