Created
January 6, 2015 17:43
-
-
Save kunal732/12e10028eb18422a9d05 to your computer and use it in GitHub Desktop.
pushing sendgrid event webhook into firebase
This file contains 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
rom flask import Flask, request | |
import json, requests | |
from firebase import firebase | |
app = Flask(__name__) | |
firebase = firebase.FirebaseApplication('Your_Firebase_url_goes_here', None) | |
@app.route('/',methods=['POST']) | |
def foo(): | |
json2 = request.json | |
data = {} | |
for event in json2: | |
for key, val in event.iteritems(): | |
data[key] = val | |
r = requests.post('Your_Firebase_url_goes_here',json.dumps(data)) | |
data = {} | |
return "OK" | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment