CodeIgniter 와 <naitik@facebook.com>의 facebook.php 를 사용한 Quick Start 가이드
Quick start on new Facebook PHP SDK (IFrame based)
Quick start on new Facebook PHP SDK (IFrame based)
try { $this->facebook = new Facebook( Array( 'appId' => $this->config->item('facebook_app_id'), 'secret' => $this->config->item('facebook_secret_key'), 'cookie' => true, 'domain' => 'phpfour.com', ) ); $session = $this->facebook->getSession(); if (!$session){ $url = $this->facebook->getLoginUrl(array('canvas' => 1, 'fbconnect' => 0)); }else{ $uid = $this->facebook->getUser(); $me = $this->facebook->api('/me'); $updated = date("l, F j, Y", strtotime($me['updated_time'])); echo "Hello {$me['name']}"; echo "You last updated your profile on " . $updated; } }catch (FacebookApiException $e){ echo "Error:" . print_r($e, true); }
반응형
'lang > php' 카테고리의 다른 글
CI twitter oauth lib haughin ver3.1 bug (0) | 2010.11.12 |
---|---|
ubuntu apm 설치 (0) | 2010.10.21 |
PHP cURL Multiple Processing (0) | 2010.10.14 |
curl "SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL" (0) | 2010.09.30 |
php integer 크기 (0) | 2010.09.28 |