TwitBot is a project mainly written in PHP, based on the GPL-3.0 license.
Another TwitterBot using OAuth
INSTALLATION ############
... You will get an authentication URL ... ... Access to that URL and authorize the app ... ... Take note of the PIN code ...
Note. If register process fails, repeat all steps from 6.
Note. I assume you are using Linux. If you use Windows or another OS review how to schedule commands automatically like CRON does
ACTIONS #######
All actions are coded in include/Actions/ folder.
To enable the actions, you must add them to $actions array in include/config.php. All actions will be executed in that order.
Every action needs to extend Action class (Action.class.php) and have the doAction() function.
Every Action class instance has two variables:
If you need to access to database, you can get the object using the getDbObject() method defined in Bot.class.php.
If you need to update any token, you can use the setToken()/getToken() methods defined in Bot.class.php.
Sample Action to retweet, every 5 heartbeats, its last mention:
file: doAlert.class.php //----------- START -------------// <?php require_once ("Action.class.php"); class doAlert extends Action { function doAction() { if ($this->heartbeat % 5) { Logger::instance()->log("Retweeting my last mention", 4); $mention = $this->bot->getMentions(1); $this->bot->doRT($mention->text); } } } ?> //------------ END --------------//