Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Wishlist #15

Open
5 of 7 tasks
corysimmons opened this issue Feb 1, 2016 · 16 comments
Open
5 of 7 tasks

Wishlist #15

corysimmons opened this issue Feb 1, 2016 · 16 comments

Comments

@corysimmons
Copy link
Owner

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. Wishlist #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.
@danreeves
Copy link

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.

@corysimmons
Copy link
Owner Author

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!

@danjford
Copy link
Collaborator

danjford commented Feb 1, 2016

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
Copy link
Collaborator

danjford commented Feb 1, 2016

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.

@corysimmons
Copy link
Owner Author

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

@danjford
Copy link
Collaborator

danjford commented Feb 2, 2016

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

@danjford
Copy link
Collaborator

danjford commented Feb 2, 2016

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

@danjford
Copy link
Collaborator

danjford commented Feb 2, 2016

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

@danjford
Copy link
Collaborator

danjford commented Feb 2, 2016

@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

@corysimmons
Copy link
Owner Author

Merge baby merge! Thank you :D

@danjford
Copy link
Collaborator

danjford commented Feb 3, 2016

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

@corysimmons
Copy link
Owner Author

👍

Why the Chrome Extension?

@danjford
Copy link
Collaborator

danjford commented Feb 3, 2016

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

@corysimmons
Copy link
Owner Author

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.

@danjford
Copy link
Collaborator

danjford commented Feb 5, 2016

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?

@corysimmons
Copy link
Owner Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants