#Croudia4PHP
Croudia API をPHPで扱うためのライブラリです。
とりあえずCroudia REST API 1.0とかexample見ればわかるはず。
##つかいかた
example見ればわかる
##メソッド一覧
getAuthorizeURL()…認証URLを返します
setAccessToken()…callbackに渡される code というGETパラメータを渡してアクセストークンをCroudia4PHPオブジェクトにセットします
refreshAccessToken()…アクセストークンを更新する 各メソッドでAPIを叩いて$c4p -> httphead[0] に"HTTP/1.1 401 Authorization Required"が入っているときに叩くといいとか
GET_statuses_public_timeline()
GET_statuses_home_timeline()
GET_statuses_user_timeline()
GET_statuses_mentions()
POST_statuses_update()
POST_statuses_update_with_media(array,file)
POST_statuses_destroy()
GET_statuses_show()
GET_secret_mails()
GET_secret_mails_sent()
POST_secret_mails_new()
POST_secret_mails_destroy()
GET_secret_mails_show()
GET_users_show()
GET_users_lookup()
GET_account_verify_credentials()
POST_account_update_profile_image(array,file)
POST_account_update_cover_image(array,file)
POST_account_update_profile()
POST_friendships_create()
POST_friendships_destroy()
GET_friendships_show()
GET_friendships_lookup()
GET_friends_ids()
GET_followers_ids()
GET_friends_list()
GET_followers_list()
GET_favorites()
POST_favorites_create()
POST_favorites_destroy()
POST_statuses_spread()
GET_trends_place()
GET_search_voices()
GET_users_search()
GET_profile_search()
GET_search_favorites()
このへんはCroudia REST API 1.0 を見て察してくれ
とりあえずパラメーターは配列にして引数に指定してやったらいいけど(array,file)
ってなってるやつは$_FILES
に格納されたのをそのまま使う。$_FILES[name]
ならfilsにnameを指定してやるなり
ローカルファイル等を扱う際は$_FILES
に配列突っ込めば使える(?)
$_FILES[$name] = array (
"name" => "ファイル名",
"type" => "mime-type(ex. image/png)",
"tmp_name"=>"ファイルへのパス。",
);
↓これでも大丈夫のはず
POST_statuses_update_with_media(array("status"=>"test"),"c:\\path\\to\\img.png");
ここらへんの仕様はころころ変わりそう(今後のマルチファイルうp対応の可能性。)