Weitere ähnliche Inhalte Ähnlich wie 3ヶ月でリア充大学生がFBアプリをリリースするまで @macrocro (20) Kürzlich hochgeladen (10) 3ヶ月でリア充大学生がFBアプリをリリースするまで @macrocro12. こっそりニュースフィード
こっそりいいね!を押すことで、
自分の「こっそりニュースフィード」に
その女の子のフィードが流れてくる
http://app.grow.pe/misscon
13. URLで推薦
女の子のFacebookユーザーの
URLを入力することで、
友達ではない女の子
でも推薦することが可能!!
ex. http://www.facebook.com/kotomi.hattanda
のようなURL
http://app.grow.pe/misscon
16. URLで推薦
これ
確認画面がでてきます。
http://app.grow.pe/misscon
17. URLで推薦
綾瀬はるかだ!!!w
http://app.grow.pe/misscon
18. Google Image Search Hack!
<form action ="http://www.google.co.jp/searchbyimage" method="hidden" enctype="multipart/form-data" target="_blank">
<input type = "hidden" name = "image_url" value = "画像のURL">
<input type = "hidden" name = "image_content" value ="">
<input type = "hidden" name = "filename" value ="">
<input type = "hidden" name = "num" value = "10">
<input type = "hidden" name = "hl" value ="ja">
<input type = "hidden" name = "bih" value ="385">
<input type = "hidden" name = "biw" value ="1280">
<input type = "Submit" name = "Search" value = "偽装アカウントかチェック!" >
</form>
http://app.grow.pe/misscon
19. FB Misscon 構成
Ubuntu 11.10
PHP + Symfony
Apache + MySQL
jQuery + Twitter Bootstrap
http://app.grow.pe/misscon
24. Faceboo PHP SDK
Facebook が提供している公式のSDK(PHP)は
イケてない!!!
$facdbook->api(“うんたら”);
何をしてるのかよくわからない。
関数名でやりたいことが分かるのがベスト!
http://app.grow.pe/misscon
25. FacebookUtil.class.php
class FacebookUtil {
var $app_id;
var $app_secret;
var $redirect_url = REDIRECT_URL;
var $access_token;
var $me;
public function FacebookUtil() {
// config/custom.ymlからアプリキー取得
$this->custom = Spyc::YAMLLoad(CUSTOM_YAML);
$this->app_id = $this->custom['core']['facebook_key']['app_id'];
$this->app_secret = $this->custom['core']['facebook_key']['app_secret'];
$this->crawler = new CrawlerTool();
$this->crawler->no_sleep = true;
$this->crawler->no_cache = true;
$this->crawler->silent = true;
$this->scope = array(
'email',
'read_stream',
'user_birthday',
'user_work_history',
'user_location',
http://app.grow.pe/misscon
26. FacebookUtil.class.php
public function getOauthUrl() {
$oauth_url = 'http://www.facebook.com/dialog/oauth?client_id='
. $this->app_id . '&redirect_uri=' . urlencode($this->redirect_url)
. '&scope='. implode(',', $this->scope);
return $oauth_url;
}
public function getAccessToken($code='') {
if (empty($code)) {
$this->access_token = sfContext::getInstance()->getUser()->get('user')->getFacebookToken();
}
$token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
. $this->app_id . '&client_secret=' . $this->app_secret
. '&redirect_uri=' . urlencode($this->redirect_url) . '&code=' . $code;
$response = $this->crawler->curlCached($token_url, array('no_cache' => true));
$arr = explode('=', $response);
if (!empty($arr[1])) {
$this->access_token = $arr[1];
}
}
http://app.grow.pe/misscon
27. FacebookUtil.class.php
public function getMe() {
if (empty($this->access_token)) $this->getAccessToken();
$graph_url = 'https://graph.facebook.com/me?access_token=' . $this->access_token . '&locale=ja_JP';
$this->me = json_decode($this->crawler->curlCached($graph_url));
}
public function getFriends($uid = '', $sub_query='') {
if (empty($this->me)) $this->getMe();
if (empty($uid)) $uid = $this->me->id;
$fql = 'SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=' . $uid.')' . $sub_query;
$graph_url = 'https://api.facebook.com/method/fql.query?query='
. rawurlencode($fql) . '&access_token=' . $this->access_token.'&format=json';
$friend_arr = json_decode($this->crawler->curlCached($graph_url));
return $friend_arr;
}
http://app.grow.pe/misscon
30. 例えば、ユーザーの友達の情報をとってくる
$fql = SELECT
uid, name,gender,locale,birthday,education,などなど...
FROM user WHERE uid
IN (SELECT uid2 FROM friend WHERE uid1=自分のID);
FQLを投げる回数が1回で済む。
http://app.grow.pe/misscon
32. THANK YOU FOR
LISTENING!
Twitterのお友達が少ないので、ぜひお友達になってください…
@macrocro
http://app.grow.pe/misscon
Hinweis der Redaktion \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n