Archive for the ‘Platform’ Category

 

mixi アプリ iOS 6 safari 3rd party cookie対応 | mixi.jp以外はリダイレクトしないように。

10月 14th, 2012

http://developer.mixi.co.jp/appli/ns/touch/cookie_enable_api/ iframeを呼ぶときにcreated_atをつけてstartを呼ぶと設定可に変わるということのようですね。 基本そのままですが、1点 set cookie処理の所を if( preg_match( ‘/^http:\/\/.*mixi.jp/’, $_GET['callback_url'] ) ){      // set cookie      setcookie(“created_at”, time(), time() + 2592000);      header(“Location: ” . $_GET['callback_url']);      exit; }else{ // error fuck } 変なリダイレクトに利用されると困るので こんな感じでcallback_urlにmixi.jp以外は何もしないようにしました。

Read full article | コメントは受け付けていません。

mixi graph API

9月 22nd, 2012

touchバージョンでやること 1. 最初のリクエストでsignatureチェックする。 http://developer.mixi.co.jp/appli/ns/touch/oauth_signature/ 2. OKだったらauthorized codeを入手 http://developer.mixi.co.jp/appli/ns/touch/api_auth/ 一回で書くと    <script type=”text/javascript” charset=”UTF-8″ src=”http://static.mixi.jp/js/application/touch.js”></script>    <script type=”text/javascript”>    mixi.init({      appId: “mixiapp-web_00000″    });    mixi.auth({      scope: “mixi_apps2 r_profile r_voice w_voice”,      state: “touch”    });    </script> で、認証画面が表示され、 ユーザーがOKすると 新方式(GraphAPI)利用に関する設定(PC、モバイル、スマートフォン) リダイレクトURIに以下のデータが返される。 ["state"]=> string(5) “touch” ["code"]=> string(40) “fc0ec7c95c05256215a7cbbe15f37296d1b79bff” 3. codeを利用して、access_tokenを取得。 この動作は、認証後すぐ行います。 […]

Read full article | コメントは受け付けていません。

mixiアプリの署名付きリクエストの公開鍵交換

2月 21st, 2012

http://developer.mixi.co.jp/news/news_apps/009994.html xoauth_signature_publickeyのパラメータをみて sr_20100323だったら古い公開鍵 sr_20120106だったら新しい公開鍵を利用してチェック それだけです。 run_appli.plページを表示する際に、「shindig_beta=1」をつけると新しいリクエストが来ること確認。 これでOKでした。 あとは、明日交換されるので、問題ないか確認。

Read full article | コメントは受け付けていません。

webdav with cadaver | mixi モバイルアプリのコンテンツ配信サーバーを利用してみる。

11月 24th, 2011

とりあえず。マウントしたりしないでwebdavにコマンドで。 yum install cadaver mixiからもらったメールにあるURLにアクセス。 cavader https://webdav.mixi-platform.com/xxxxxxx/ Authentication required for Mixi CDN Authorization on server `webdav.mixi-platform.com': Username: Password: dav:/xxxxxx/faces/> mput *jpg [Matching... 6 matches.] Uploading f_006.jpg to `/xxxxxx/faces/f%5f006.jpg': Progress: [=============================>] 100.0% of 196 bytes succeeded. Uploading f_002.jpg to `/xxxxxx/faces/f%5f002.jpg': Progress: [=============================>] 100.0% of 196 bytes succeeded. Uploading f_005.jpg to `/xxxxxx/faces/f%5f005.jpg': Progress: [=============================>] 100.0% of 196 […]

Read full article | コメントは受け付けていません。

opensocial Standard Query Parameters

11月 23rd, 2011

http://opensocial-resources.googlecode.com/svn/spec/0.9/REST-API.xml#standardQueryParameters count, startIndex とか

Read full article | コメントは受け付けていません。

convert utf-8 to sjis filter for mobile | zend filter

11月 21st, 2011

mixiモバイルがsjisなので、フィルターを入れる。 SJISに変換するfilterを作る。 http://framework.zend.com/manual/ja/zend.filter.writing_filters.html class Lib_Filter_Encoding_Utf2sjis implements Zend_Filter_Interface { public function filter($value) { return mb_convert_encoding( $value, ‘SJIS’, ‘UTF-8′ ); } } viewにsetFilter $view->setFilterPath(‘/mylib/grow.dev/Lib/Filter/Encoding’,’Lib_Filter_Encoding’)->setFilter( ‘Utf2sjis’ ); (zend通すときはnamespace使わない。

Read full article | コメントは受け付けていません。

opensocial collection

11月 7th, 2011

http://code.google.com/intl/ja/apis/opensocial/docs/0.7/reference/opensocial.Collection.html asArray() で配列に変換できると。

Read full article | コメントは受け付けていません。

opensocial persistent API | mixi

10月 18th, 2011

http://developer.mixi.co.jp/appli/spec/pc/share_info/ mixiアプリでデータ保存を利用したいときに、 JSONや日本語を入れる時の注意点。 まず日本語もJSONデータにする。データが大きくなるのでサイズを計算しましょう。 エスケープされて 1 文字 6 バイト消費します。 JSON.stringifyでjson化して保存した後読み出すとき、parseする前にunescapeする必要があります。 html entityがエスケープされて保存されています。 {&#34;u&#34;:&#34;1318900612392&#34;} こんな感じで。 なので、 JSON.parse(gadgets.util.unescapeString(data)); のようにunescapeStringを利用してからparse。

Read full article | コメントは受け付けていません。

allow from .example.com | reverse lookup | apache

10月 6th, 2011

IPで制限しないでとmixiさんが言っていたので http://developer.mixi.co.jp/news/news_platform/20111003api_ip/ とりあえず、mixiから以外は見えないように <Location /gadgets > Order deny,allow Deny from all Allow from .mixi-reserve.com .mixi.jp </Location> を設定しました。 ちなみに、逆引き設定は、offのままですが、gadgets以下のときだけonになってくれているのか、それとも全体がonになってしまっているのかは不明。。。 # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it’d be overall better for the net if people # had to […]

Read full article | コメントは受け付けていません。

gadget xml cache | mixi appli

10月 3rd, 2011

PC向け開発をしているときに、xmlのキャッシュが・・・なのでキャッシュしないようにするには、以下のように nocache パラメーターをつけるだけで良いようです。 http://mixi.jp/run_appli.pl?id=XXXXX&nocache=1

Read full article | コメントは受け付けていません。