EasyBotter1.4 OAuth対応
Basic認証なのでOAuthに対応させる
参考
http://www26.atwiki.jp/easybotter_wiki/pages/23.html
http://d.hatena.ne.jp/hebita164/20100425/1272210734
oauth_test.txtを入手
http://www.sdn-project.net/labo/oauth_test.txt
0.2.0-beta3をダウンロード
http://github.com/abraham/twitteroauth/zipball/0.2.0-beta3
OAuth.php twitteroauth.php oauth_test.php
この3つのファイルを同じディレクトリにup
あとは手順通りにやればOK
特につまるところも無いので手順は省略
oauth_test.txt→oauth_test.php
twitteroauth.php→twitterOAuth.php
にリネームするくらい
このままでは
Easybotterからになるので、自分の指定したクライアント名が出るようにする。
ここを参考に
http://www26.atwiki.jp/easybotter_wiki/pages/19.html
メモ1
Twitter API で "Status is a duplicate." エラーがでる。
→TwitterはAPI経由での「ほぼ同時の同じ内容の発言を受け付けない」
こんなWarningが出てうまく投稿できない
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/xxx/OAuth.php on line 301
Wikiに書いてあるのと引数のとり方が変わっているために出ていた
※もともと違っていたのか、変更されたのかは不明
OAuthRequest('http://twitter.com/statuses/replies.json', array(), 'GET');
↓
OAuthRequest('http://twitter.com/statuses/replies.json', 'GET', array());
全部変更したら無事投稿できるようになった。