A Laravel Twitter bot proof of concept
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bootstrap
config
database
public
resources
routes
storage
tests
.env.example
.gitattributes
.gitignore
artisan
composer.json
composer.lock
license.txt
package.json
phpunit.xml
readme.md
server.php
webpack.mix.js

readme.md

Laravel Twitter Bot

This app sends random tweets (selected from a database) periodically (each hour) and automatically, through the Laravel task scheduling. This project doesn't have a graphical user interface.

You can read how I developed this app in my blog: Creating a Laravel Twitter bot

Requirements

You need shell access to a server with the server requirements for a Laravel 5.5 application:

  • PHP >= 7.0.0
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

You need to create a Twitter app and the four keys from the app:

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

Install the bot

  • Clone the project.
git clone https://github.com/amieiro/laravel-twitter-bot.git
  • Run composer
composer install
  • Modify the seeder if you need to change it: edit the database/seeds/TweetsTableSeeder.php file.

  • Create the database

touch database/laravel-twitter-bot.sqlite
  • Migrate the database with the seeder
php artisan migrate:refresh --seed
  • Create the .env file
cp .env.example .env
  • Add the 4 keys from the Twitter app in the .env file.

  • Add the scheduler in the cron

* * * * * php /home/vagrant/Code/web/laravel-twitter-bot/artisan schedule:run >> /dev/null 2>&1

License

The Laravel Twitter Bot is open-sourced software licensed under the GNU GPL v3.