[Assorted-commits] SF.net SVN: assorted:[1049] facebook-tools/trunk/src
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-11-02 04:02:31
|
Revision: 1049 http://assorted.svn.sourceforge.net/assorted/?rev=1049&view=rev Author: yangzhang Date: 2008-11-02 04:02:29 +0000 (Sun, 02 Nov 2008) Log Message: ----------- oops, revealed previous secret key Modified Paths: -------------- facebook-tools/trunk/src/fb.py facebook-tools/trunk/src/update-facebook-friends-api.py Modified: facebook-tools/trunk/src/fb.py =================================================================== --- facebook-tools/trunk/src/fb.py 2008-11-02 03:01:52 UTC (rev 1048) +++ facebook-tools/trunk/src/fb.py 2008-11-02 04:02:29 UTC (rev 1049) @@ -8,12 +8,16 @@ parameter. """ +from __future__ import with_statement +import os from facebook import * from commons.startup import run_main def fb_session(): 'Create/authenticate a FB session.' - fb = Facebook('f5a7a02ea0cfd954bf8fb5504ffbf49a', '2a57c669977f9e813b8fd9496f6d3746') + with file(os.path.expanduser('~/.fb.auth')) as f: + apikey, seckey = f.read().strip().split('\n') + fb = Facebook(apikey, seckey) fb.auth.createToken() fb.login() raw_input('press enter to cont...') Modified: facebook-tools/trunk/src/update-facebook-friends-api.py =================================================================== --- facebook-tools/trunk/src/update-facebook-friends-api.py 2008-11-02 03:01:52 UTC (rev 1048) +++ facebook-tools/trunk/src/update-facebook-friends-api.py 2008-11-02 04:02:29 UTC (rev 1049) @@ -4,6 +4,7 @@ # IF PYTHON 2.5 #from __future__ import with_statement # END IF +import os import syck import facebook as fb import itertools @@ -47,8 +48,8 @@ new_dict.update( old_waiting_dict ) # Initialize FB API - api_key = 'f5a7a02ea0cfd954bf8fb5504ffbf49a' - sec_key = '2a57c669977f9e813b8fd9496f6d3746' + with file( os.path.expanduser( '~/.fb.auth' ) ) as f: + api_key, sec_key = f.read().strip().split('\n') facebook = fb.Facebook( api_key, sec_key ) facebook.auth_createToken() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |