Archive for the ‘Platform’ Category

 

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 bytes succeeded.
Uploading f_004.jpg to `/xxxxxx/faces/f%5f004.jpg’:
Progress: [=============================>] 100.0% of 196 bytes succeeded.
Uploading f_001.jpg to `/xxxxxx/faces/f%5f001.jpg’:
Progress: [...]

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がエスケープされて保存されています。

{"u":"1318900612392"}

こんな感じで。
なので、

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 [...]

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 | コメントは受け付けていません。

restful apiで使えるもの使えないもの | mixi touch mobile

9月 6th, 2011

mixi touchで少し作っていたら
http://developer.mixi.co.jp/appli/spec/touch/introduction/

RESTful API
Person & Friends
Activity ※
Persistence ※
※同時にモバイルにも対応しているアプリのみ利用可能

ちょっと理由はわかりませんが、Activity, Persistenceを使うには、モバイルも対応していないといけないそうです。
PCよりかと思ったらモバイルより?
ちょっとPCで作りたいものがあったので
touch + PCのイメージだったけど
touch + mobileへ思考変換

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

mixiアプリ署名付きリクエスト認証のために OauthProvider を使ってみる | PHP

8月 26th, 2011

http://www.php.net/manual/en/class.oauthprovider.php
↓ここを見てやってみろと書いてあるので
・Writing an Oauth Provider Service
http://toys.lerdorf.com/archives/55-Writing-an-OAuth-Provider-Service.html
・Oauth Provier sample
http://svn.php.net/viewvc/pecl/oauth/trunk/examples
なんかできない気がしたので諦めた。
http://developer.mixi.co.jp/appli/spec/pc/require_servers/
一通りこちらのOauth.phpは読んだので、まねして、使うところだけ実装。
無事完了
・mixiからのリクエストのsignatureチェック
・mixiへのリクエストの作成。
やることはほとんど同じで。
基本機能はだいたいわかったので、明日は、インターフェイスのベース作成とデータ設計を。
来週中にはリリースできそう。でも次のツールも考えてるので。

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