Yahoo! Messenger PHP BOT
- Created: 02/16/2012
- latest Update: 02/25/2012
- By: nr913
- Live chat support;
- General information query BOT;
- Newsletter BOT;
- Remote control via Yahoo! Messenger.
- Super easy to implement;
- Supports file transfers through Yahoo! relay servers. That means, you don’t have to worry about port forwarding;
- Manage events more easily with the callback system;
- OOP with Exceptions make it more user-friendly.
- sample.php, Can be used as a template for projects;
- sample_info.php, Displays general information. I made it do display currency and weather;
- sample_remote.php, Makes shell commands and transfers files via Yahoo! Messenger;
- sample_support.php, A simple principle of managing clients for a live chat session support.
What can you use it for?
Having no particulary best use, the BOT can fullfill a great variety of tasks, such as:
It can easily adopt a practical use, according to your need.
What’s so special with this BOT?
What’s in the package?
There are two main files, YBot.Class.php and YBot.Const.php. These are the core files.
Beside these two, four sample files are included:
How can you use it?
Good question. First, you have to include the main file, YBot.Class.php.
include ('YBot.Class.php');
Then, make an instance of YBot class, passing to the constructor the ID and Password of the account the BOT will log into.
$Bot = new YBot('yahoo_id','password');
To run the BOT process, simply call Start method
$Bot->Start();
But that will just start the bot. Beware, after Start method is called, everything below that line will get called after the bot stops. Any initialization you do, you must do it before this line.
echo "Before start"; $Bot->Start(); echo "After start"; // prints just "Before start", because bot process is still running.
Of course, if you want to handle incoming messages, files and so on, you have to register a callback, like so
$Bot->RegisterEvent('message', 'OnIncomingMessage'); function OnIncomingMessage($from, $message) { global $Bot; // handle the message $Bot->SendMessage($from, "I don't know what to say..."); }
Documentation about events, methods and their parameters can be found in the begining of YBot.Class.php.
So, a basic BOT file should look like this:
<?php // include the bot class include ('YBot.Class.php'); // instantiate the bot $Bot = new YBot('yahoo_id', 'password'); // register our callbacks $Bot->RegisterEvent('message', 'OnIncomingMessage'); // declare the callbacks function OnIncomingMessage($from, $message) { global $Bot; $Bot->SendMessage($from, "I don't know what to say.."); } // start the bot process $Bot->Start(); ?>
Changelog
[02/25/2012] Fixed a bug for large packets
[02/16/2012] Version 1.0 released
If I ever happen to improve the BOT, I’ll let you know about it. Updates are free.
[eltd_button size=”huge-full-width” type=”outline” text=”Download & Demo Links” custom_class=”#” icon_pack=”font_awesome” fa_icon=”” link=”” target=”_blank” color=”” hover_color=”” background_color=”” hover_background_color=”” border_color=”” hover_border_color=”” font_size=”” font_weight=”” margin=””]
Demo = Yahoo! Messenger PHP BOT
[eltd_button size=”huge” type=”” text=”Full Live Demo” custom_class=”” icon_pack=”font_awesome” fa_icon=”fa-laptop” link=”https://codecanyon.net/item/yahoo-messenger-php-bot/1600967″ target=”_blank” color=”” hover_color=”” background_color=”” hover_background_color=”” border_color=”” hover_border_color=”” font_size=”” font_weight=”” margin=””]
Kindly Note: We update new contents like WordPress Themes, Plugins, PHP Scripts everyday. But remember that you should never use this items in a commercial website. All the contents posted here for development & testing purpose only. We’re not responsible for any damage, use at your own RISK! We highly recommend to buy Yahoo! Messenger PHP BOT from the The Developer ( nr913 ) website. Thank you.
Download = Yahoo! Messenger PHP BOT-[Updated].zip