#NEWLINE# @ route ( '/realtime_callback' ) #NEWLINE# @ post ( '/realtime_callback' ) #NEWLINE# def on_realtime_callback( ) : #NEWLINE# #INDENT# mode = request . GET . get ( 'hub.mode' ) #NEWLINE# challenge = request . GET . get ( 'hub.challenge' ) #NEWLINE# verify_token = request . GET . get ( 'hub.verify_token' ) #NEWLINE# if challenge : #NEWLINE# #INDENT# return challenge #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# x_hub_signature = request . header . get ( 'X-Hub-Signature' ) #NEWLINE# raw_response = request . body . read ( ) #NEWLINE# try : #NEWLINE# #INDENT# reactor . process ( CONFIG [ 'client_secret' ] , challenge , x_hub_signature ) #NEWLINE# #UNINDENT# except subscriptions . SubscriptionVerifyError : #NEWLINE# #INDENT# print ( 'Signature mismatch' )