最近、私は素晴らしいチュートリアルHow to Authenticate Users With Twitter OAuthを読みましたが、Twitter ID 形式を変更する前に書かれていましたが、新しい Twitter ID 形式でも機能します。
いくつか質問があります。誰かが成功したかどうか説明してください..
getRequestToken
常に 2 つのメソッドと を呼び出すのはなぜgetAccessToken
ですか?access token
とを取得することaccess token secret
ですか?しかし、両方ともすでに以下のページで提供されています...http://dev.twitter.com/apps/ {your_app_id}/my_token.
リクエストトークンとリクエストトークンシークレットの正確な必要性は何ですか?? ただし、処理するたびに両方のトークンが異なることに気付きました。
以下のメソッドからステータスを更新する場合
$connection->post( 'statuses/update', array('status' => 'some message got from text area value' );
では、ステータスが正常に更新されたことを確認するにはどうすればよいでしょうか?? 警告メッセージを表示したい場合post has been sent successfully
、PHP ページにどのように実装すればよいでしょうか??
どのコールバック URL が重要か、つまり、ユーザーが Twitter に投稿したり何かをしたりした後に実際にナビゲートされる場所は?
Registered OAuth Callback URL
アプリ開発時に書いてあるURLですか?http://dev.twitter.com/apps/{id_no}
また私たちのphpコード(
config.php
)で定義されているURLですか?define('OAUTH_CALLBACK', 'http://www.xyz.com');
もう1つのQ'n
- アプリケーションのアクセス拒否を処理するには?
注:これに関する私の質問を参照してください
@Thaiの更新
私はあなたの提案に従って以下を行いました
$user_info = $connection->get('account/verify_credentials');
$status_info =$connection->get('statuses/show/', array('id' =>32320907720523776) );
echo "<pre>";
print_r($status_info);
echo "</pre> Content : <pre>";
print_r($user_info);
以下に戻ります
stdClass Object
(
[request] => /1/statuses/show.json?id=3.2320907720524E%2B16&oauth_consumer_key=jashak..&oauth_nonce=bec...&oauth_signature=%2FMj%2B0Z7oyYNKdMn%2B%2FOJ6Ba8ccfo%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1296541384&oauth_token=223961574-cW4...&oauth_version=1.0a
[error] => No status found with that ID.
)
注:oauth_consumer key
セキュリティ上の理由から、oauth_nonce
を非表示にしていoauth_token
ます ;)
Content:
stdClass Object
(
[follow_request_sent] =>
[profile_link_color] => 038543
[profile_image_url] => http://a3.twimg.com/profile_images/1215444646/minialist-photography-9_normal.jpg
[contributors_enabled] =>
[favourites_count] => 31
[profile_sidebar_border_color] => EEEEEE
[id_str] => 223961574 // this is also id_str
[status] => stdClass Object
(
[retweeted] =>
[id_str] => 32320907720523776 // this id_str i used
[in_reply_to_status_id_str] =>
[geo] =>
[contributors] =>
[source] => Black Noise
[in_reply_to_user_id_str] =>
[retweet_count] => 0
[truncated] =>
[coordinates] =>
[created_at] => Tue Feb 01 06:14:39 +0000 2011
[favorited] =>
[text] => Twitter test: verify that status has been updated
[place] =>
[in_reply_to_screen_name] =>
[in_reply_to_status_id] =>
[id] => 3.2320907720524E+16
[in_reply_to_user_id] =>
)
[screen_name] => ltweetl
[profile_use_background_image] => 1
....
...
エラーが発生しましたがNo status found with that ID
、どのid_str
ウルが言及していますか??