Last active
July 11, 2018 20:00
-
-
Save charlesreid1/3f771f42c26b7324eb490be69644f013 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callWebhook(e) { | |
var url = "http://52.53.248.136:5000/webhook"; | |
// Form questions/columns in the spreadhseet: | |
// | |
// Timestamp | |
// What is your first name | |
// What is your last name | |
// What team are you on | |
// What is your username | |
var payload = { | |
"values0" : e.values[0], // presumably this is the timestamp | |
"values1" : e.values[1], | |
"values2" : e.values[2], | |
"values3" : e.values[3], | |
"values4" : e.values[4] | |
} | |
var options = { | |
"method" : "post", | |
"contentType" : "application/json", | |
"payload" : JSON.stringify(payload) | |
}; | |
return UrlFetchApp.fetch(url, options) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from flask import Flask, request, jsonify | |
""" | |
a simple flask web app for testing out the google forms webhook | |
""" | |
app = Flask(__name__) | |
@app.route('/', methods=['GET']) | |
def home(): | |
return "<h2>Hello world!</h2>" | |
@app.route('/webhook', methods=['POST']) | |
def add_message(): | |
content = request.json | |
print(content) | |
return jsonify({"status":"ok"}) | |
if __name__ == '__main__': | |
app.run(host= '0.0.0.0',port="5000",debug=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'values0': '7/11/2018 13:00:07', 'values1': 'retwret', 'values2': 'yreth', 'values3': 'team 1, team 3', 'values4': 'oiusofdiusoidfuosiufoisuofisudof'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment