Twitter Utilities (TwUtils) is an open source platform offers set of utilities for managing your twitter account.. Built with Laravel, VueJs.
TwUtils uses two different Twitter applications, One for Read-Only operations, One for Read-Write operations.
Read-Only operations includes: User Basic Info Data, Backup Tweets/Likes/Followings/Followers.
Read-Write operations includes: Delete Tweets, Delete Likes.
Head over to Twitter Developers to create two Twitter applications.
After creating the twitter application, you can set it's Permissions (Read-Only, Read-Write,..) from the Permissions tab.
For each application, In the Keys and tokens tab, you will have Consumer API keys for each permission, which is two keys:
- API key
- API secret key
This keys will be used later to authenticate users and to be used as an access point for TwUtils.
Consumer API Keys will be used in the .env file, explanation below.
Note: Do not forget to "Enable Sign in with Twitter" while creating the applications.
- Tutorial: Create Twitter Developer Account & App
This application is built on top of Laravel Framework v8, It assumes composer is installed and php has the needed extensions. For details please refer to Laravel 8 Installation documentation.
git clone https://github.com/MohannadNaj/twutils/ twutils
cd twutils
composer install
npm installcp .env.example .env
php artisan key:generate
php artisan storage:link
Update the following environment variables in your .env file to match your database.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=twutils
DB_USERNAME=
DB_PASSWORD=
Here you will set the Consumer API Keys you created when you created the twitter application.
For Read-Only Application, Set the following keys in your .env file:
# API key
TWITTER_CLIENT_ID="XXXX"
# API secret key
TWITTER_CLIENT_SECRET="XXXX"
For Read-Write Application, Set the following keys in your .env file:
TWITTER_READ_WRITE_CLIENT_ID="XXXX"
TWITTER_READ_WRITE_CLIENT_SECRET="XXXX"
In the Twitter Developers portal, Under the App details tab or upon creation of a new Twitter Application, it asks you to set callbacks URLs.
This URLs are where Twitter users will be redirected after they grant the permission for your application to access their Twitter account.
APP_PORT="8000"
TWITTER_REDIRECT="http://localhost:%s/login/twitter/callback"
TWITTER_REDIRECT_READ_WRITE="http://localhost:%s/login/twitter/rw/callback"
php artisan serve
Visit: http://localhost:8000/
If you discover any security related issues, please email mohannadnaj@me.com instead of using the issue tracker.
- Backend:
vendor/bin/phpunit- Frontend:
composer testData # to generate dummy data from the backend
npm test