• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
 

fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)

on

  • 1,627 views

リリースから2ヶ月で約5万件のメッセージが送信されたFacebookメッセージグループ送信ツール「fb-research」についてこちら(http://atnd.org/events/24642)のイベ...

リリースから2ヶ月で約5万件のメッセージが送信されたFacebookメッセージグループ送信ツール「fb-research」についてこちら(http://atnd.org/events/24642)のイベントで講演しました。

fb-research:http://grow.pe/fbr/

Statistics

Views

Total Views
1,627
Views on SlideShare
1,490
Embed Views
137

Actions

Likes
1
Downloads
0
Comments
0

2 Embeds 137

http://dunjiii.com 92
http://hotdog-republic.com 45

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会) fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会) Presentation Transcript

    • Fb-researchの舞台裏2 (技術編) HatchUp CSO @modeelf
    • fb-researchとは・・・facebookメッセージを一斉に送れるツールです
    • メッセージ送信数の推移 5万2000件 (3/15現在) TechWave 男子ハック 掲載 掲載 あけおめ 4万件突破 メッセージ 3万件突破
    • 構成Ubuntu 11.10PHP+symfonyApache+MySQL+MongoDB+GoogleDocs
    • About EngineeringFacebookの提供している公式のSDK(PHP)はイケてない→自前でFacebook接続系をクラス化lib/FacebookUtil.class.php
    • About Engineeringlib/FacebookUtil.class.phpclass FacebookUtil { … public function FacebookUtil() { // config/custom.ymlからアプリキー取得 $this->custom = Spyc::YAMLLoad(/path/to/project/config/custom.yml); $this->app_id = $this->custom[core][facebook_key][app_id]; $this->app_secret = $this->custom[core][facebook_key][app_secret]; $this->scope = array( email, read_stream, xmpp_login, offline_access, // 2012/02/20廃止 user_birthday, user_work_history, user_location, user_likes, user_education_history, friends_birthday, friends_work_history, friends_location, friends_likes, friends_education_history, ); ...
    • About Engineering
    • About Engineeringlib/FacebookUtil.class.php---core: facebook_key: app_id: 012345678901234 app_secret: a1s2d3f4g5h6j7k8l9hoge app_url: http://grow.pe/fbr/
    • About EngineeringFacebookアプリキー設定管理画面
    • About Engineeringlib/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(); } else { $this->access_token = $code; } $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]; } }
    • About Engineering lib/FacebookUtil.class.phppublic function getMe() { if (empty($this->access_token)) $this->getAccessToken(); $graph_url = https://graph.facebook.com/me?access_token= . $this->access_token; $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 id, name FROM profile WHERE id 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;}
    • about DesignHatchUpではデザイナを募集しています
    • about MonetizeFb-researchの仕組みを絶賛ASP(SaaS)形式で提供中!お問い合わせはinfo@hatchup.jpまで
    • Thank you for listening!