]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove the default facebook api key from the demo.
authorBen Darnell <ben@bendarnell.com>
Sun, 24 Aug 2014 15:50:47 +0000 (11:50 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 24 Aug 2014 15:50:47 +0000 (11:50 -0400)
This app has apparently been deactivated by facebook.

Closes #1132.

demos/facebook/README
demos/facebook/facebook.py

index 2f0dc28e84f5378195b21876fe9584634a98addf..145868bd861bbccbae2082c7b623b46f6d0ac73b 100644 (file)
@@ -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
index e252e298f5ab38f04a59aa07099f766b908a141d..5390a82f1ae69f59e265bf4ab13cc0e0dead9fba 100755 (executable)
@@ -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()