By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.
Could be modified to be more advanced (match regular expressions to answer questions, etc.)
Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa
Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1
I get this errors :S
Notice: Use of undefined constant STDIN - assumed 'STDIN' in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php on line 123
Warning: fread() expects parameter 1 to be resource, string given in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php on line 123
PIN Number:
Notice: Use of undefined constant STDIN - assumed 'STDIN' in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php on line 126
Warning: fread() expects parameter 1 to be resource, string given in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php on line 126
Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)' in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php:130 Stack trace: #0 C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php(130): OAuth->getAccessToken('https://twitter...', '', '') #1 C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php(53): TwitterAutoReply->doAuth() #2 C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\example.php(12): TwitterAutoReply->run() #3 {main} thrown in C:\Users\USER\Dropbox\Documentos\Desarrollo Web\xampp\htdocs\twitterbot\TwitterAutoReply.php on line 130