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

URL to download sheet data in sandstorm #340

Open
zeigerpuppy opened this issue Apr 25, 2016 · 7 comments
Open

URL to download sheet data in sandstorm #340

zeigerpuppy opened this issue Apr 25, 2016 · 7 comments

Comments

@zeigerpuppy
Copy link

It would be great if there was a static version of the .tsv data stored at a URL,
this would enable pulling the sheet into other programs (I'm thinking that ShareLaTeX with knitr may be a nice way to pull dynamic data for charts into a LaTeX doc)

@ocdtrekkie
Copy link

To the left of the A column, and above the 1 row, there's a download button. It offers HTML, CSV, and EXCEL options.

@zeigerpuppy
Copy link
Author

Oh good, that's helpful,
I am trying to grab the URL of the export in CSV format but it's not shown in the dialogue and I guess must be generated after the buttons are shown.
For pulling the data into R (and knitr), it needs a URL to call the data.
Is it possible to display the URL somehow?

@zeigerpuppy
Copy link
Author

I tried pulling the data from the generated URL,

https://b404ce20a3c4b373fcXXX2f8219bb85ss.myserver.net/sheet1.csv

However, this only works from the browser that generated the request.
Pulling from another session (even for the same authenticated user)
generates the error:

Error: Unauthorized [403]
    at Proxy.makeContext (server/proxy.js:1512:15)
    at server/proxy.js:1711:20
    at C (/node_modules/es6-promise.js:12:57)
    at /node_modules/es6-promise.js:17:252
    at t (/node_modules/es6-promise.js:9:473)
    at process._tickCallback (node.js:458:13)

@eddyparkinson
Copy link
Collaborator

zeiger, did you make the sheet public?  ---
Eddy Parkinson PhD
Software Engineering
New ideas pass through three periods: 1) It cant be done. 2) It probably can be done, but its not worth doing. 3) I knew it was a good
idea all along! - Arthur C. Clarke

On Tuesday, 26 April 2016, 10:44, zeigerpuppy <notifications@github.com> wrote:

I tried pulling the data from the generated URL,https://b404ce20a3c4b373fcXXX2f8219bb85ss.myserver.net/sheet1.csvHowever, this only works from the browser that generated the request.
Pulling from another session (even for the same authenticated user)
generates the error:Error: Unauthorized [403]
at Proxy.makeContext (server/proxy.js:1512:15)
at server/proxy.js:1711:20
at C (/node_modules/es6-promise.js:12:57)
at /node_modules/es6-promise.js:17:252
at t (/node_modules/es6-promise.js:9:473)
at process._tickCallback (node.js:458:13)

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@zeigerpuppy
Copy link
Author

zeigerpuppy commented May 2, 2016

I tried with the a publically shared link (view only)
and I get a URL using the download button:

https://4e7a896865552dkjh30614eaff91c4ss.myserver.net/sheet1/sheet1.csv

However, the URL is not returning any data, with error:

Cannot GET /sheet1/sheet1.csv

It looks like it's parsing the link incorrectly, as when I go to the URL:

https://4e7a896865552dkjh30614eaff91c4ss.myserver.net/sheet1.csv

it then downloads correctly

@zeigerpuppy
Copy link
Author

zeigerpuppy commented May 2, 2016

The URL that is created still seems to require confirmation too, it is actually and HTML link initially instead of a .csv link

This is fine from a browser, but is problematic when using a command like curl or wget

I guess sandstorm is noticing a request and trying to log in first.
It looks like this:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/8a99fc504e0a0b6eff08c44cb6tyh9bddcbb72dc.css?meteor_css_resource=true">
<title>Sandstorm</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>
<body>



<script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.3.1%22%2C%22meteorEnv%22%3A%7B%22NODE_ENV%22%3A%22production%22%2C%22TEST_METADATA%22%3A%22%7B%7D%22%7D%2C%22PUBLIC_SETTINGS%22%3A%7B%22build%22%3A161%2C%22kernelTooOld%22%3Afalse%2C%22allowDemoAccounts%22%3Afalse%2C%22allowDevAccounts%22%3Afalse%2C%22isTesting%22%3Afalse%2C%22hideTroubleshooting%22%3Afalse%2C%22wildcardHost%22%3A%22*ss.myserver.net%22%7D%2C%22ROOT_URL%22%3A%22https%3A%2F%2Fss.myserver.net%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22appId%22%3A%221hvnmnh1urfyo1f8yle9%22%2C%22autoupdateVersion%22%3A%22455bbd33906c6ab838851392a0fd0e66a04e8dfa%22%2C%22autoupdateVersionRefreshable%22%3A%2254842344b9e1640f91a4429265daf4bc5c3b9af9%22%2C%22autoupdateVersionCordova%22%3A%22none%22%7D"));</script>

  <script type="text/javascript" src="/05eea1f39a5296d8efcf49663486112011bebafc.js?meteor_js_resource=true"></script>


</body>
</html>

@audreyt
Copy link
Owner

audreyt commented May 22, 2016

Hmm I'm afraid it's a Sandstorm-level issue.

One thought is to generate CSV JSON HTML Excel OpenDocument exports etc into /var/www and issue a redirect. Would someone like to explore this path? https://docs.sandstorm.io/en/latest/developing/web-publishing/

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

No branches or pull requests

4 participants