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

make api for stats using google sheets #48

Open
Junumboxo opened this issue Apr 2, 2020 · 2 comments
Open

make api for stats using google sheets #48

Junumboxo opened this issue Apr 2, 2020 · 2 comments
Assignees

Comments

@Junumboxo
Copy link
Contributor

Junumboxo commented Apr 2, 2020

@alexkingdom o sa faca un rest api si o sa puna in public. Datele o sa fie luate de la gis. Dupa detalii la mine @grigore-fiodorov sau la @alexkingdom

@vmelnic
Copy link
Collaborator

vmelnic commented Apr 4, 2020

Suggestion.
In order to send the data from gsheet (or any other supported source) to info.c19.md you can also use Zapier for free https://zapier.com/home and only handle the request from Zapier webhook in your app, instead of integrating google api/sdk and so.

@johnsmithm
Copy link
Contributor

johnsmithm commented Apr 4, 2020

  • the path to the google sheet here
  • path to API from google sheet here change 1 to 2 to get the second sheet
  • here is some code to get the table out of API, need to be changed to js and update the variable from data.js
data = jsonFromAPI get request
cols = max([int(i['gs$cell']['col']) for i in data['feed']['entry']])
rows = max([int(i['gs$cell']['row']) for i in data['feed']['entry']])
df = [['' for i in range(cols)] for j in range(rows)]
for i in data['feed']['entry']:
    col = int(i['gs$cell']['col'])
    row = int(i['gs$cell']['row'])
    #print(i['gs$cell'])
    df[row-1][col-1] = i['gs$cell']['inputValue']
  • the API from the GIS is not available anymore, they ask for a token

@grig-ian-theo grig-ian-theo self-assigned this Apr 8, 2020
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