├── .DS_Store ├── Procfile ├── __pycache__ ├── app.cpython-36.pyc └── config.cpython-36.pyc ├── app.json ├── app.py ├── requirements.txt └── runtime.txt /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dancarmel/webhook2notion/c26baf9e6045a6a7eeb7cd2d2af231051c901234/.DS_Store -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: python app.py -------------------------------------------------------------------------------- /__pycache__/app.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dancarmel/webhook2notion/c26baf9e6045a6a7eeb7cd2d2af231051c901234/__pycache__/app.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dancarmel/webhook2notion/c26baf9e6045a6a7eeb7cd2d2af231051c901234/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Webhook 2 Notion table", 3 | "description": "Create a webhook where you can send todo's that will be added to your notion account", 4 | "repository": "https://git.heroku.com/nameless-scrubland-94978.git", 5 | "keywords": ["notion", "webhook", "notion-py"] 6 | } 7 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | from notion.client import NotionClient 4 | from flask import Flask 5 | from flask import request 6 | 7 | 8 | app = Flask(__name__) 9 | 10 | 11 | def createNotionTask(token, collectionURL, content): 12 | # notion 13 | client = NotionClient(token) 14 | cv = client.get_collection_view(collectionURL) 15 | row = cv.collection.add_row() 16 | row.title = content 17 | 18 | 19 | @app.route('/create_todo', methods=['GET']) 20 | def create_todo(): 21 | 22 | todo = request.args.get('todo') 23 | token_v2 = os.environ.get("TOKEN") 24 | url = os.environ.get("URL") 25 | createNotionTask(token_v2, url, todo) 26 | return f'added {todo} to Notion' 27 | 28 | 29 | if __name__ == '__main__': 30 | app.debug = True 31 | port = int(os.environ.get("PORT", 5000)) 32 | app.run(host='0.0.0.0', port=port) 33 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.10.1 2 | notion -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.6.3 --------------------------------------------------------------------------------