Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
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.

Recent activity

Toby Thain

Toby Thain pushed 1 commit to trmanco/phIRCe

e42cc89 - Improve URL detection especially for Diaspora post bodies. Don't show redirection landing site hint if the page title already has it.
Toby Thain

Toby Thain pushed 1 commit to trmanco/phIRCe

d7a515d - Fix bugs where raw messages with newlines were sent to irc server. Truncate long messages and never send multiple lines.
Toby Thain

Toby Thain pushed 2 commits to trmanco/phIRCe

84a81e1 - Bump version.
693a9ac - Try to reconnect if PONG fails, or on involuntary QUIT. Auto-shorten long URLs. Simplify title presentation.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.