phIRCe is an IRC bot written in PHP that can control a channel, perform searches on Google, fetch the titles from many URLs and archive their content. Runs only on the Freenode network. Requirements: - PHP 5.3+ - sockets extension - Curl extension for extracting title of web pages, and archiving them - JSON extension for parsing results of !google command - DOM/libxml extensions for extracting text of twitter.com and identi.ca URLs Usage: - Download a copy of the bot - Extract the files somewhere on your filesystem - Edit config.php to fit your needs - Start the bot with php -q ~/path/to/phirce/bot.php - Have fun Website: http://bitbucket.org/trmanco/phirce/ Get the source: http://bitbucket.org/trmanco/phirce/src/ (Mercurial repository) Feel free to contribute in any way you can, some L10n would be great. Installing Prerequisites Centos 5.5 (may also work for other releases, including Fedora and RHEL) ---------- The default php includes curl and libxml. 1) Install json support: Check if the pecl utility exists, with # which pecl If not, # yum install pear-php pear-devel Check if gcc exists, with # which gcc If not, # yum install gcc Then: # pecl install json Make sure a file /etc/php.d/json.ini exists, with the content: extension = json.so Test with: # php -r 'json_decode("");' (if no error is printed, json support is installed.) 2) Install DOM support: # yum install php-xml Test with: # php -r 'DOMDocument::loadHTML("x");' (if no error is printed, DOM support is installed.) Troubleshooting --------------- Failure to authenticate with Twitter: If your credentials are correct, but you see Authenticating with Twitter... 0; SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed then your curl CA bundle may be out of date. It can be updated by downloading and extracting the latest curl sources (I used curl-7.33.0), and running this command in the source directory: $ lib/mk-ca-bundle.pl Then replace the installed bundle with the generated file ca-bundle.crt (you will need root permissions to do this). The path to the CA bundle should be given in the verbose output of curl; on my system it is /usr/share/curl/curl-ca-bundle.crt.
e42cc89 - Improve URL detection especially for Diaspora post bodies. Don't show redirection landing site hint if the page title already has it.
d7a515d - Fix bugs where raw messages with newlines were sent to irc server. Truncate long messages and never send multiple lines.
c21222a - Bump version.
842b4b4 - Clean up parameter handling and logging.
3769139 - Fix problem matching URLs that contain balanced ()'s (e.g. some Wikipedia URLs).
47086c5 - Improve error checking in Twitter auth.
cb38c6b - Bump version.
b795906 - Fix bug in parameter parsing.
6b657b4 - Limit redirect depth to 20. Improve handling of twitter result errors.
cc6a929 - Match optional www. on diaspora URLs.
1728af2 - Emit bot messages as NOTICEs.
84a81e1 - Bump version.
693a9ac - Try to reconnect if PONG fails, or on involuntary QUIT. Auto-shorten long URLs. Simplify title presentation.
720a14c - Tweak highlighting.