Skip to content

A skeleton to create a bot that replies when you mention it, easily customizable!

Notifications You must be signed in to change notification settings

phosphore/twitter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter-bot

A skeleton to create a bot that replies when you mention it, easily customizable 📦

〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️

Installation

  1. Make sure you have Composer

  2. Clone the twitter-bot repository into the workbench and install dependencies

    git clone https://github.com/phosphore/twitter-bot.git workbench/twitter-bot
    cd workbench/twitter-bot
    composer install
    
  3. Register an application and change the consumerKey, consumerSecret, accessToken and accessTokenSecret from 'events/bot.json'

  4. Customize the replies

  5. Open bot.php and change the path for your json configuration file

  6. Set up a cron job to execute bot.php

You may also want to play with the code in bot.php. I tried to comment it as much as possible for your understanding, but you may need to read the Twitter API's doc to have an idea of what kind of objects are returned.

Demo

Squarify bot uses this piece of software. You can tweet an image mentioning @squarifybot and it will reply with the modified picture.

〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️

👾 Use it responsibly 👾

About

A skeleton to create a bot that replies when you mention it, easily customizable!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages