??????????????腟???????????????????с????鴻???????????障?????鐚?????????

??????????ц???????≪???????????????c??????с?ゃ????c???帥?????oAuth???絲上???????<????c????????????????

twitteroauth.php?????拷????????curl???????с?????篏????????????????????????????障?????

篏???c??篋?

???????吟??????????????http://twitter.com/kotobuki_t

???????潟???若??

http://ko-lab.net/wp-content/uploads/2010/01/easyoauth20100111.zip



篁ヤ??readme????潟?????
??祉??????????????

???????????????

PHP??х亜??????TwitterAPI???篏帥?????????????????????∽?亥召??с?????

?????????篏帥??????????????c??亜??????BOT???PHP???????粋昭?????ф?宴????????????с??鐚????????????鐚???障?????

??堺?????????1??ゃ???∽?違??1??ゃ??API?????宴????障?????

oAuth絲上????с?????

綽?荀?????>散

PHP?????宴???????????

PHP???????若?吾?с??5.0.0篁ヤ??

4.X.X??с?????????障?????鐚??????荐若?с?????5.0.0??ц申??????????????∽?違??篏帥?c?????????????????????????????????????障?????鐚?

PEAR???HTTP_Request???篏帥???????????

???????∽?亥召???篏帥?c???????????????????荐?????????綽?

篏帥?????

1.茹e???????障??



2.oAuth???篏帥????翫?????ID???????鴻???若?????篏帥????翫???????????????障?????





???oAuth???篏帥????翫??



???????????config.inc.php???????????? USE_OAUTH ??? true ??????????????????????



箴?鐚?

define(”USE_OAUTH”, true);



罨<????篁ヤ?????????若?吾????Twitter???OAuth??????ゃ?≪?潟??????脂?蚊?????茵???c????????????????鐚?@sdn_tome???????????茗?鐚?鐚?

???PHP???OAuth???篏帥??羣????????????絎??????若?吾??????????????潟???若???????荀?????????障????????

茹e?????????????<?ゃ?????帥?с?????絎?茵???с????障?????



Callback URL???????http://???????鴻???????????????????????泣?若?????????<?ゃ??/??鴻?????????????????????/callback.php

??????????????????????



箴?鐚?(botfolder???В??????????????<?ゃ?????????鴻???ャ?c??????障??)

http://botserver.com/botfolder/callback.php





PHP+OAuth???Twitter – SDN Project

http://wolf.silk.to/labo/oauth.html





罨<??config.inc.php???????????? CONSUMER_KEY ??? CONSUMER_SECRET ???荐????????障?????



箴?鐚?

define(”CONSUMER_KEY”, “1qa2sws4ed4rf5tg6yh7uj8iiiiiki”);

define(”CONSUMER_SECRET”, “3572759f6bdc087e3517ddbfbb15c5b0″);





荐????????????????違??茹e?????????????<?ゃ????web??泣?若????寂??????≪?????????若??????????????????????



罨<???????oAuth??у????????????????≪?????潟????????Twitter??????違?ゃ?潟???????????????????



???????倶????с????≪?????????若????????????????????????index.php????≪???祉?鴻???????????????????



箴?鐚?(botfolder???В??????????????<?ゃ?????????鴻???ャ?c??????障??)

http://botserver.com/botfolder/index.php





Access Token ??? Access Token Secret??????????ャ?c?????????????????腆肴??????????????????????



???????????筝???????????Sign in with Twitter???????吾???????????????帥?潟???????????????????????????????



Twitter??眼??oAuth茯?荐主?脂?≪??????????с?????荐怨???????????????????????



???腟?????????Access Token ??? Access Token Secret?????絖?????????ャ?c????倶?????????若?吾????冴??????障??????с??

config.inc.php???????????? ACCESS_TOKEN ??? ACCESS_TOKEN_SECRET ???荐???????????????????????

???絖?????????ャ?c???????????c????翫??????????若?????????帥????????????????



?????????????帥?潟???????c????贋??????????茵?ず???????????????????????障????????????????違?с?????????oAuth?????<???????????????????????????????鴻????с?????





config.inc.php?????≪?????????若?????????泣?若????寂?????????<?ゃ??????贋?違???????????????????



config.inc.php?????≪?????????若?????????泣?若????寂?????????<?ゃ??????贋?違??????????綽???????????с??????????????





紊т???????????????э??鐔?鐔?



?????????oAuth???┃絎??????????????с?????





???ID???????鴻???若?????篏帥????翫??



???????????config.inc.php???????????? USE_OAUTH ??? false ??????????????????????



箴?鐚?

define(”USE_OAUTH”, false);





??????????? LOGINNAME ??? LOGINPASS ???荐???????????????????????

箴?鐚?

define(”LOGINNAME”,”kotobuki_t”); ?? ??//twitter??????若??ID

define(”LOGINPASS”,”password”);//twitter???????鴻???若??





茹e?????????????????????賢???????鴻????????<?ゃ??????泣?若??????≪?????????若???????障?????



???????????с?????





3.???????∽?亥召???篏帥????鴻????????????

require “tw.php”;

???菴遵???????障?????

??????????????????┃絎????????≪?????????若????????????????????????????????????????∽?亥召???篏帥????鴻??????????????ャ???????翫?????

???┃絎???????с????ャ???????????????????翫?????????篆??????????????????????



4.篏帥??????????∽?違????吾????障?????



5.??泣?若??筝????friend_since_id.txt ??? dm_since_id.txt ?????吾??莨若?水??純??????с??????障?????

666???606???600???????????с???????????



6.??≪?????????若????????????????????????腆肴???????障?????



7.???????????????????蚊??罕???с?????????????????????c??????????綣泣?c???????????「????????????????????





???define(”__DEBUG”,true); ????ゃ?????

??潟?<?潟????≪?????????????twitter??????菴???c????????????若?帥????阪??????????障?????

篏????罧級?????API?????宴?????????????????????腆肴??????????翫?????梢????с?????

莇?膂≦????泣?潟??????潟?若??

???絎?????????????POST???????????????亜???????潟?若????с?????

篁ヤ???????潟????若?????test.php?????????????<?ゃ????篏???c??????若?鴻??????????泣?若??筝???у??茵????????帥????????????????

<?php



require "tw.php";



$message = "?????鴻?????腮?";



//mb_convert_encording??ф??絖???潟?若?????UTF-8?????????????????????????????????????????????障??

$message = mb_convert_encoding($message, "UTF-8", "ASCII,JIS,UTF-8,EUC-JP,SJIS");



tw_update_post($message);



?>



?????吟?????????????鐚?

????ゃ?祉?潟?拷?≫??

oAuth???篏帥????翫?????abraham羂???????ゃ?祉?潟?鴻??????c????????????????

?????吟????????絽??????????????????ぇ筝?紊?????????????障?????

篏帥?????????翫?????tw.php????帥??????若?с?????





?????????????c????翫??????潟?<?潟??罨????@kotobuki_t??障?