OSDN Git Service

Procfile error
[simple-tornado-bot/simple-tornado-bot.git] / bot.py
1 # -*- coding: utf-8 -*-
2 """
3 Created on Sat Sep  1 11:18:39 2018
4
5 @author: fuke masasi
6 """
7
8 import tornado.ioloop
9 import tornado.web
10 import json
11
12
13 verify_token = <VERIFY_TOKEN>
14
15 class WebhookHandler(tornado.web.RequestHandler):
16     def get(self):
17         token = self.get_argument('hub.verify_token','')
18         if token == verify_token:
19             write(token)
20         else:
21             write('Error, wrong varidation Token.)
22
23 application = tornado.web.Application([(r'webhook',WebHookHandler)])
24
25 if __name__ == '__main__':
26     application.listen(5000)
27     tornado.ioloop.IOLoop.instance().start()