You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current method for calling the published Google spreadsheet is this: <script src="http://spreadsheets.google.com/feeds/list/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/0/public/values?alt=json-in-script&callback=phenClockGDImport"></script>
key is the long string of numbers and symbols that make up the unique identifier for the spreadsheet. I know of three ways we would take this key as input.
The Google drive link when you are editing the spreadsheet: https://docs.google.com/spreadsheets/d/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/edit#gid=0
The publish link for the HTML version: https://docs.google.com/spreadsheets/d/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/pubhtml
And simply the key itself: 1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk
I believe the length will always be 32 characters so a regex like this should work: [a-z0-9_-]{32,}
worksheet is the name (and/or?) number of the sheet within the document. I've tried to swap out spreadsheets only to have them return a 400 error because I didn't take the sheet into account.
It appears the 0 is the default. So any input could simply have an optional sheet input as well. e.g. [ input key here ] [sheet # ]
Ideas on how to manage key
I think that there could simply be a variable in the index.html that holds the key an worksheet values.
Why not a little gear icon, which pops up a modal with a “Add you spreadsheets share link here" and then someone just pastes the spreadsheet URL?
We can parse out the info we need.
And theres no hard coding, I don’t think we should support sheets for MVP.
key is the long string of numbers and symbols that make up the unique identifier for the spreadsheet. I know of three ways we would take this key as input.
And simply the key itself: 1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk
I believe the length will always be 32 characters so a regex like this should work: [a-z0-9_-]{32,}
worksheet is the name (and/or?) number of the sheet within the document. I've tried to swap out spreadsheets only to have them return a 400 error because I didn't take the sheet into account.
It appears the 0 is the default. So any input could simply have an optional sheet input as well. e.g. [ input key here ] [sheet # ]
Ideas on how to manage key
I think that there could simply be a variable in the index.html that holds the key an worksheet values.
The current method for calling the published Google spreadsheet is this:
<script src="http://spreadsheets.google.com/feeds/list/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/0/public/values?alt=json-in-script&callback=phenClockGDImport"></script>
The src URL has two a few important URI components (to us) which you can read in detail about in the link above.
http://spreadsheets.google.com/feeds/**feed**/**key**/**worksheet**/public/basic?alt=json-in-script&callback=myFunc
key is the long string of numbers and symbols that make up the unique identifier for the spreadsheet. I know of three ways we would take this key as input.
The Google drive link when you are editing the spreadsheet:
https://docs.google.com/spreadsheets/d/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/edit#gid=0
The publish link for the HTML version:
https://docs.google.com/spreadsheets/d/1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk/pubhtml
And simply the key itself:
1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk
I believe the length will always be 32 characters so a regex like this should work:
[a-z0-9_-]{32,}
worksheet is the name (and/or?) number of the sheet within the document. I've tried to swap out spreadsheets only to have them return a 400 error because I didn't take the sheet into account.
It appears the
0
is the default. So any input could simply have an optional sheet input as well. e.g.[ input key here ] [sheet # ]
Ideas on how to manage key
I think that there could simply be a variable in the index.html that holds the key an worksheet values.
We could also check for a hash value in the URL:
http://phenclock.org/pclock/index.html#1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk
or a variable pair:
http://phenclock.org/pclock/index.html?key=1CWmIrQ9Ic1R81kpFg2eCL21dH-XLeBkRkqMnOWDlDuk&worksheet=1
Which will allow us to accept the worksheet too.
The text was updated successfully, but these errors were encountered: