From 7d3f710e81ba6c2b46038e61d11a23c254fb0a6b Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 24 Aug 2014 11:50:47 -0400 Subject: [PATCH] Remove the default facebook api key from the demo. This app has apparently been deactivated by facebook. Closes #1132. --- demos/facebook/README | 13 +++++++------ demos/facebook/facebook.py | 9 +++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/demos/facebook/README b/demos/facebook/README index 2f0dc28e..145868bd 100644 --- a/demos/facebook/README +++ b/demos/facebook/README @@ -1,8 +1,9 @@ Running the Tornado Facebook example -===================================== -To work with the provided Facebook api key, this example must be -accessed at http://localhost:8888/ to match the Connect URL set in the -example application. +==================================== -To use any other domain, a new Facebook application must be registered -with a Connect URL set to that domain. +To run this example, you must register a Facebook application with a +Connect URL set to the domain the this demo will be running on +(i.e. http://localhost:8888/ by default). The API key and secret +for this application must be passed on the command line: + + python facebook.py --facebook_api_key=ABC --facebook_secret=XYZ diff --git a/demos/facebook/facebook.py b/demos/facebook/facebook.py index e252e298..5390a82f 100755 --- a/demos/facebook/facebook.py +++ b/demos/facebook/facebook.py @@ -25,10 +25,8 @@ import tornado.web from tornado.options import define, options define("port", default=8888, help="run on the given port", type=int) -define("facebook_api_key", help="your Facebook application API key", - default="9e2ada1b462142c4dfcc8e894ea1e37c") -define("facebook_secret", help="your Facebook application secret", - default="32fc6114554e3c53d5952594510021e2") +define("facebook_api_key", help="your Facebook application API key", type=str) +define("facebook_secret", help="your Facebook application secret", type=str) class Application(tornado.web.Application): @@ -113,6 +111,9 @@ class PostModule(tornado.web.UIModule): def main(): tornado.options.parse_command_line() + if not (options.facebook_api_key and options.facebook_secret): + print("--facebook_api_key and --facebook_secret must be set") + return http_server = tornado.httpserver.HTTPServer(Application()) http_server.listen(options.port) tornado.ioloop.IOLoop.instance().start()