@@ -7,7 +7,7 @@ This PHP script allows you to post tweets to **X** (formerly known as Twitter) u
77- ** PHP** installed on your system (PHP 7.2 or higher recommended).
88- ** cURL extension** enabled in PHP.
99- A ** Twitter Developer Account** (X Developer Account) with an app that has ** Read and Write** permissions.
10- - ** Composer** (optional) — only needed if you use environment variables via ` vlucas/phpdotenv ` .
10+ - ** Composer** (optional) - only needed if you use environment variables via ` vlucas/phpdotenv ` .
1111
1212## Getting Started
1313
@@ -35,6 +35,10 @@ API_KEY=your_api_key
3535API_SECRET_KEY=your_api_secret_key
3636ACCESS_TOKEN=your_access_token
3737ACCESS_TOKEN_SECRET=your_access_token_secret
38+ TWITTER_BACKEND=twitter
39+ XQUIK_API_KEY=your_xquik_api_key
40+ XQUIK_ACCOUNT=your_x_account_username
41+ XQUIK_API_BASE=https://xquik.com/api/v1
3842```
3943
4044#### Option 2: Using config.php
@@ -47,11 +51,31 @@ define('API_KEY', 'your_api_key');
4751define('API_SECRET_KEY', 'your_api_secret_key');
4852define('ACCESS_TOKEN', 'your_access_token');
4953define('ACCESS_TOKEN_SECRET', 'your_access_token_secret');
54+ define('TWITTER_BACKEND', 'twitter');
55+ define('XQUIK_API_KEY', 'your_xquik_api_key');
56+ define('XQUIK_ACCOUNT', 'your_x_account_username');
57+ define('XQUIK_API_BASE', 'https://xquik.com/api/v1');
5058?>
5159```
5260
5361Note: For security reasons, ensure that config.php and .env are added to your .gitignore file and not committed to version control.
5462
63+ ### Optional: Posting with Xquik
64+
65+ If you use Xquik for X automation, set ` TWITTER_BACKEND ` to ` xquik ` .
66+ The script will send the configured tweet to ` POST /api/v1/x/tweets ` with your Xquik API key.
67+
68+ Required values:
69+
70+ ``` dotenv
71+ TWITTER_BACKEND=xquik
72+ XQUIK_API_KEY=your_xquik_api_key
73+ XQUIK_ACCOUNT=your_x_account_username
74+ XQUIK_API_BASE=https://xquik.com/api/v1
75+ ```
76+
77+ The default ` twitter ` backend keeps using X API v2 OAuth 1.0a directly.
78+
5579### Customize Your Tweet
5680
5781Edit the post_tweet.php script to customize the tweet content:
0 commit comments