1. authorize infinite session, in fact will generate the auth token.
http://www.facebook.com/code_gen.php?v=1.0&api_key=0723b8c9a62020afa5aa598de74f38b2
=>
http://www.facebook.com/login.php
Input the username and password to log in
=>
http://www.facebook.com/tos.php?api_key=0723b8c9a62020afa5aa598de74f38b2&v=1.0&code_gen
=>
http://www.facebook.com/code_gen.php?v=1.0&api_key=0723b8c9a62020afa5aa598de74f38b2
=>
https://login.facebook.com/code_gen.php
auth_token=JBAJEQ
2. Based on the auth token, get the session
Plain text:
api_key=0723b8c9a62020afa5aa598de74f38b2auth_token=JBAJEQformat=JSONmethod=facebook.auth.getSessionv=1.0aabde09a0b29baf951e0dab47fbac2e1
Firstly sort the key set of the query parameters map, then format into one string:
[key1=value1][key2=value2]...[keyn=valuen][application_secret]
The online md5 generator link:
http://www.excel2mysql.com/onlinetools/md5/md5encode.php
Signature:
05551b11da22b5e70367df5eb4d7c291
URL:
http://api.facebook.com/restserver.php?api_key=0723b8c9a62020afa5aa598de74f38b2&auth_token=JBAJEQ&format=JSON&v=1.0&method=facebook.auth.getSession&sig=05551b11da22b5e70367df5eb4d7c291
The JSON formatted response will be returned:
{"session_key":"7720ae12c3eec336ae0c321b-1548049248","uid":1548049248,"expires":0}
3. Add extended permission
http://www.facebook.com/authorize.php?v=1.0&api_key=0723b8c9a62020afa5aa598de74f38b2&ext_perm=status_update&popup=1
4. Invoke the api to update status
Plain text:
api_key=0723b8c9a62020afa5aa598de74f38b2format=JSONmethod=facebook.users.setStatussession_key=7720ae12c3eec336ae0c321b-1548049248status=LaborDayHolidaystatus_includes_verb=0v=1.0aabde09a0b29baf951e0dab47fbac2e1
Signature:
6967c2ffcc21bfc0e8fa31cf35ea4d39
URL:
http://api.facebook.com/restserver.php?api_key=0723b8c9a62020afa5aa598de74f38b2&format=JSON&v=1.0&method=facebook.users.setStatus&status=LaborDayHoliday&status_includes_verb=0&session_key=7720ae12c3eec336ae0c321b-1548049248&sig=6967c2ffcc21bfc0e8fa31cf35ea4d39
2009年4月30日星期四
订阅:
博文评论 (Atom)
没有评论:
发表评论