Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

hinaloe/Croudia4PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 

Repository files navigation

#Croudia4PHP

Croudia API をPHPで扱うためのライブラリです。
とりあえずCroudia REST API 1.0とかexample見ればわかるはず。

##つかいかた

example見ればわかる

##メソッド一覧

Auth

getAuthorizeURL()…認証URLを返します
setAccessToken()…callbackに渡される code というGETパラメータを渡してアクセストークンをCroudia4PHPオブジェクトにセットします
refreshAccessToken()…アクセストークンを更新する 各メソッドでAPIを叩いて$c4p -> httphead[0] に"HTTP/1.1 401 Authorization Required"が入っているときに叩くといいとか

Timeline

GET_statuses_public_timeline()
GET_statuses_home_timeline()
GET_statuses_user_timeline()
GET_statuses_mentions()

statuses

POST_statuses_update()
POST_statuses_update_with_media(array,file)
POST_statuses_destroy()
GET_statuses_show()

secret mail

GET_secret_mails()
GET_secret_mails_sent()
POST_secret_mails_new()
POST_secret_mails_destroy()
GET_secret_mails_show()

user

GET_users_show()
GET_users_lookup()

settings

GET_account_verify_credentials()
POST_account_update_profile_image(array,file)
POST_account_update_cover_image(array,file)
POST_account_update_profile()

follow

POST_friendships_create()
POST_friendships_destroy()
GET_friendships_show()
GET_friendships_lookup()
GET_friends_ids()
GET_followers_ids()
GET_friends_list()
GET_followers_list()

favorites

GET_favorites()
POST_favorites_create()
POST_favorites_destroy()

spread

POST_statuses_spread()

Trends

GET_trends_place()

Search API

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対応の可能性。)