Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalinks should detect truncated gist content and fetch full raw content #62

Closed
swanson opened this issue Jul 21, 2015 · 1 comment
Closed

Comments

@swanson
Copy link

swanson commented Jul 21, 2015

Visit this page: https://sports.yahoo.com/dailyfantasy/api/resource/dailyfantasy.players;contestId=22306

Paste that content into the site and it works great. But when I try to create a permalink and reload the page, not all of the content is copied over so the CSV conversion does not work.

Directly pasting in:

image

Using permalink: http://konklone.io/json/?id=8ed32e80cd9408d29987

image

Any ideas what might be happening?

Windows 8.1
Chrome 43

@konklone
Copy link
Owner

It looks to me like this is a Gist limitation. If you visit your permalink in the converter, you can see that the input is truncated from what you saved. If you visit the Gist that backs your permalink, you can see that GitHub truncates it in the display to the exact same character as it's truncated in the converter (which gets its content from the Gist API).

https://gist.github.com/anonymous/8ed32e80cd9408d29987

And if you look in the Gist API, the API does indeed truncate it to the same place:

https://api.github.com/gists/8ed32e80cd9408d29987

Gist does provide the full content of what you saved, if you click through to the full raw data.

I can also see that the Gist API provides a truncated field, marked true in the response above. So, the converter could look for that field and then make a second request to fetch the full data from a Gist. I've confirmed that gist.githubusercontent.com has CORS headers set, and we should be okay to do that with our static page.

I'm renaming the issue to make it reflect what it would take to fix this. Up for submitting a PR for it? I can also do this, but it'll probably need to wait until the weekend.

@konklone konklone changed the title Trouble creating permalink Permalinks should detect truncated gist content and fetch full raw content Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants