Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Cees-Jan Kiewiet:
Phergie Slack setup and configuration
Jan 05, 2016 @ 10:27:28

Cees-Jan Kiewiet has posted a tutorial to his site showing how to connect Phergie to Slack through a custom gateway. Phergie is a popular PHP open source IRC bot project in use in several channels on the Freenode.net IRC network.

Ever since the rise of Slack and the Phergie v3 connecting them has been on my to do list. And while Slack API is the better alternative this was fun nontheless.

He walks you through some of the prerequisites for the setup including a working installation of the Phergie bot (installations instructions not included). From there he helps you make the custom Gateway and make a user for the bot to operate under. He then includes the settings and configuration you'll need to configure on the bot to allow it to join the Slack instance.

tagged: phergie slack configuration setup tutorial bot irc

Link: http://blog.wyrihaximus.net/2016/01/phergie-slack-setup-and-configuration/

Hasin Hayder:
Creating a slack bot using PHP to monitor your envato sales
Oct 05, 2015 @ 10:43:03

Hasin Hayder has posted a tutorial to his site showing you how to create a bot for Slack that will monitor your sales on Envato connected via their API.

Slack is awesome. Slack is the de-facto of modern team communication and I am pretty sure that this is not the first time you’re hearing something like this about slack. But if you’re really never used slack, oh boy, I feel pity for you. Anyway, in this article we’re going to make a slack bot that will monitor the sales in our envato account and notify from time to time as soon as someone purchased an item. Pretty useful, eh?

He shows how to make a new channel in your Slack instance (he uses "#sales") and how to add in a named webhook to connect the bot to. He then generates a token on the Envato service to access their API, giving it the needed permissions. He includes the simple curl-based script to make the request to the Envato API to get the latest results and then turn around and post it back to the Slack channel.

tagged: slack bot envato sales api channel automate tutorial

Link: http://hasin.me/2015/10/05/creating-a-slack-bot-using-php-to-monitor-your-envato-sales/

HHVM Blog:
Faster GitHub Commits
Jul 09, 2014 @ 09:23:19

On the Facebook HHVM blog they talk about an improvement they've made to the project allowing for faster GitHub commits on the project. They've reworked things to move away from a manual process on the popular project and automate as much as possible.

Initially, the entire process was manual. We would curl the pull request and pipe it to git am, then manually prepare the diff for review internally. After it was accepted, we would manually prepare the internal commit to be usable externally by GitHub, then manually build and test the new code, and finally git push. Great scripts by ptarjan and sgolemon to help get and prepare pull requests for review and then prepare the commits for GitHub have alleviated some of this manual process. However, in the end, someone still had to manually build, test and then push the code to the world.

Another feature of this effort is a new cron job (facebook-github-bot) that pushes any internal (approved) HHVM code automatically without having to wait for the manual intervention. It syncs all code since the last push, runs all tests and, assuming all went well, pushes it out to GitHub.

we believe that getting your code into the master branch quickly will hopefully help show how much we appreciate your contributions. Now, if there was only a way we could get your pull requests reviewed faster and more openly…. Hmmm…
tagged: github commit release bot continuous integration

Link: http://hhvm.com/blog/5399/faster-github-commits

Robert Basic's Blog:
Creating a chat bot with PHP and Dbus
Jan 09, 2012 @ 11:10:52

Robert Basic has continued his series looking at using Dbus in PHP with this latest post to his blog - using the foundation he's created before to make a chat bot that will listen and respond to commands on a Jabber network.

Now that we know how to use DBus to communicate with Pidgin from PHP and how to listen to DBus signals, it’s time to put it all together by creating a simple chat bot! Nothing fancy, just a simple script that runs somewhere on some server and, by using a Pidgin account, can respond to some basic queries we send it.

His new code listens for an incoming message on the "PurpleInterface", grabs the name of the sender and calls a "PurpleConvImSend" method with the conversation object and the message to send. You can find the complete source for the project on his github account.

tagged: dbus tutorial pigdin extension pecl chat bot jabber

Link:

Matthew Turland's Blog:
Environmental Awareness Quickie
Jul 28, 2008 @ 07:57:00

Matthew Turland came across someone having an issue running his PHP-based IRC bot (Phergie) an an environment where the exec function wasn't allowed:

This causes a warning in the Quit plugin, which uses exec to automatically detection of the full path to the PHP CLI binary on non-Windows systems that it will later use that path to initiate a new PHP CLI process to "restart" the bot.

It check this setting for the future, it was recommended that he look at the SPL ReflectionFunction class (a part of the Standard PHP Library) that would let him check the disabled status of any PHP function (looking at the result of the isDisabled call).

tagged: spl isdisabled reflection exec irc bot phergie exec

Link:

C7Y:
Reflections on Designing an IRC Bot in PHP, Part 2
Apr 18, 2008 @ 11:14:56

Matthew Turland notes that the second part of his "IRC Bots in PHP" series of articles has been posted to the C7Y community site (from php|architect).

The precursor to this article introduced some background and an overview of the design for the Phergie project as an example of the concepts involved in a PHP IRC bot implementation. This article will go further into the topic of plugins including descriptions of those that are commonly needed to make a bot fully functional as well as the commonly needed core features to support plugin development.

In part one he set up some of the foundation code and explained some of the thought behind the structure of the bot. In this part he gets more into the heart of the bot, showing how to define functions for common IRC actions (join/part/ping/etc) and how he made a plugin system to handle custom actions. He also mentions topics like memory usage, data storage methods and some of the "niceties" he included.

tagged: irc bot tutorial example plugin action memory phergie

Link:

C7Y:
Reflections on Designing an IRC Bot in PHP, Part 1
Apr 08, 2008 @ 15:25:01

Matthew Turland set out a while back to develop a bot in PHP. The result of it is Phergie an "an IRC bot written in PHP 5 with an OO API" that can be extended with components for a wide variety of features. Another pleasant offshoot from his project is this first part of two articles on the C7Y community site detailing its creation.

The PHP Community channel on the Freenode IRC network, #phpc, had a longstanding bot called "Ai". Like many bots at the time of her creation, she was based on PHP 4. [...] With the coming end-of-life of PHP 4 and at the encouragement of channel users, I decided to start a project to develop a new bot based on PHP 5 that would fully utilize its new object model and offer users a chance to contribute to the bot they used in their channel.

Matthew talks about the initial stages of development (planning, research) and some of the development process of the bootstrap file, configuration file, and driver as well as the event handling.

tagged: design irc bot tutorial c7y pecl extension libircclient

Link:

Matthew Turland's Blog:
Meet Phergie
Feb 25, 2008 @ 10:13:00

Matthew Turland has been working on a project based on an idea he and Ben Ramsey thought up - a wrapper around the libircclient libraries to make IRC interface simple. As a result, Matthew turned it into a more practical application - you can call her Phergie.

I had toyed with some previous iterations of Phergie, some Python-based and later some PHP-based, before I finally got an API design I was happy with.

The source for the bot can be downloaded from its subversion repository and you can find out more about it on its Trac site. Also, if you feel like chatting about it, you can head over to the #phergie channel on the Freenode IRC network.

tagged: phergie irc bot pecl libircclient library project plugin

Link:

PHP-GTK Community Site:
Gataka: the PHP-GTK IRC bot
Jan 28, 2008 @ 10:36:00

The admins over on the PHP-GTK Community site have announced a new resource PHP-GTK ircers can take advantage of - a new bot that hangs out in the #php-gtk channel over on the Freenode IRC network with an aim to be as helpful as possible.

The PHP-GTK.eu community site is now host to an IRC bot named Gataka (for "GTK"), helping users on the Freenode IRC channel for PHP-GTK, at irc://irc.freenode.net/php-gtk.

Currently is has an API interface (for PHP-GTK elements), user tracking and the ability to learn factoids. They're even starting to look for input regarding new features (log publication, in this case).

tagged: irc bot phpgtk api reference user track factoid

Link:

PHPClasses.org:
CAPTCHA harder to break using animations
Dec 07, 2006 @ 08:28:00

PHPClasses.org is spotlighting another package from their site today - this time it's a CAPTCHA class that takes things a step further and introduces animation into the mix to make it even harder for bots to get through.

Laszlo Zsidi is a PHP Web developer that has written an harder to break CAPTCHA solution. It consists in generating animated GIF images that exhibit the validation text.

Since the text never appears all at once in each of the animated frames, this solution certainly raises the bar in terms of difficulty for the robots to guess the validation text, making it very hard to defeat, if possible at all.

You can check out the class here, including a sample animated gif file and a download of everything you'll need to get started.

tagged: captcha animation gif validation spam bot captcha animation gif validation spam bot

Link: