Add Facebook notification agent

This commit is contained in:
JonnyWong16 2015-12-31 22:59:59 -08:00 committed by Jonathan Wong
parent 754df5bea7
commit 7befbef6ec
8 changed files with 713 additions and 29 deletions

View file

@ -695,12 +695,29 @@ class WebInterface(object):
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
tweet = notifiers.TwitterNotifier()
result = tweet._get_credentials(key)
logger.info(u"result: " + str(result))
# logger.info(u"result: " + str(result))
if result:
return "Key verification successful"
else:
return "Unable to verify key"
@cherrypy.expose
def facebookStep1(self):
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
facebook = notifiers.FacebookNotifier()
return facebook._get_authorization()
@cherrypy.expose
def facebookStep2(self, code):
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
facebook = notifiers.FacebookNotifier()
result = facebook._get_credentials(code)
# logger.info(u"result: " + str(result))
if result:
return "Key verification successful, you may close this page now."
else:
return "Unable to verify key"
@cherrypy.expose
def osxnotifyregister(self, app):
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"