Skip to content

Commit 02ffec6

Browse files
committed
Add optional Xquik posting backend
1 parent f449780 commit 02ffec6

4 files changed

Lines changed: 275 additions & 92 deletions

File tree

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ API_KEY=your_api_key
22
API_SECRET_KEY=your_api_secret_key
33
ACCESS_TOKEN=your_access_token
44
ACCESS_TOKEN_SECRET=your_access_token_secret
5+
TWITTER_BACKEND=twitter
6+
XQUIK_API_KEY=your_xquik_api_key
7+
XQUIK_ACCOUNT=your_x_account_username
8+
XQUIK_API_BASE=https://xquik.com/api/v1

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
3535
API_SECRET_KEY=your_api_secret_key
3636
ACCESS_TOKEN=your_access_token
3737
ACCESS_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');
4751
define('API_SECRET_KEY', 'your_api_secret_key');
4852
define('ACCESS_TOKEN', 'your_access_token');
4953
define('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

5361
Note: 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

5781
Edit the post_tweet.php script to customize the tweet content:

config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
define('API_SECRET_KEY', 'YOUR_API_SECRET_KEY');
44
define('ACCESS_TOKEN', 'YOUR_ACCESS_TOKEN');
55
define('ACCESS_TOKEN_SECRET', 'YOUR_ACCESS_TOKEN_SECRET');
6+
define('TWITTER_BACKEND', 'twitter');
7+
define('XQUIK_API_KEY', 'YOUR_XQUIK_API_KEY');
8+
define('XQUIK_ACCOUNT', 'YOUR_X_ACCOUNT_USERNAME');
9+
define('XQUIK_API_BASE', 'https://xquik.com/api/v1');
610
?>

0 commit comments

Comments
 (0)