XQueue
A file-based post scheduler for X (Twitter). Your file system is the UI.
How It Works
Create a folder structure with days and times. Drop tweet files into the time slots. A cron job checks every 15 minutes — if it's the right day and time and there's content, it posts and cleans up.
CODEBLOCK0
The schedule cycles weekly. Monday's 9am slot fires every Monday at 9am. If the folder is empty, it pulls the oldest file from backlog/ (sorted alphabetically). If there's content in the slot, it posts that and backlog waits. This means you can schedule up to a week of specific content, and dump everything else in backlog — it'll fill empty slots automatically.
After posting, files are deleted (by default) so they don't repeat.
Setup
Run the setup command to create your queue:
CODEBLOCK1
This asks you:
- 1. How many times per day do you want to post?
- What times? (or let it pick optimal times)
- What timezone?
- Any X communities to post to?
- Thread separator preference (default: ---)
- Delete after posting? (recommended yes — if off, posts may send twice)
Creates the full folder structure + config.json.
Tweet Format
Simple tweet
Just write the text in a
.md or
.txt file:
CODEBLOCK2
Tweet with community
Start with
Post to [community name]: on the first line:
CODEBLOCK3
Thread
One file, tweets separated by your configured separator (default
---):
CODEBLOCK4
Tweet with media
Put image/video files in the same time folder as the tweet. Supported: JPG, PNG, GIF (under 5MB for images, 15MB for GIF).
CODEBLOCK5
If multiple media files exist, they attach in alphabetical order (max 4 per tweet).
Config
INLINECODE5 :
CODEBLOCK6
During setup, paste the community URL (like x.com/i/communities/123456) or the numeric ID directly. The script extracts the ID and asks for a display name. Plain names without an ID are rejected — everything needed to post is captured upfront.
Backlog
The xqueue/backlog/ folder holds tweets that aren't scheduled for a specific slot. When the cron fires and a time slot is empty, it pulls the oldest file from backlog (alphabetical sort — prefix with numbers like 01-, 02- to control order).
This lets you batch-write content without worrying about fitting it into exactly the right number of weekly slots. Schedule what's time-sensitive, backlog the rest.
Cron Integration
The skill includes a cron job that runs every 15 minutes:
- - Checks current day + time against folder structure
- If slot has content → post it
- If slot is empty → pull oldest from INLINECODE10
- If both are empty → skip
- Logs results to posted.log
- Deletes posted files (if deleteAfterPost is on)
What Goes Where
| You want to... | Do this |
|---|
| Schedule a tweet for Tuesday 9am | Drop a .md file in INLINECODE11 |
| Post a thread |
One .md file with
--- between tweets |
| Attach an image | Put the image file in the same folder as the .md file |
| Post to a community | Start text with
Post to Community Name: |
| Reorder posts | Move files between time folders |
| Skip a time slot | Leave the folder empty |
| See what's queued | Browse the xqueue folder |
| See what already posted | Check xqueue/posted.log |
| Queue content without a specific time | Drop it in
xqueue/backlog/ |
| Control backlog order | Prefix filenames:
01-first.md,
02-second.md |
Important
- - deleteAfterPost: true (default) means each file posts once then gets removed. If you turn this off, the same content will post again next week when the cycle repeats.
- Tweets over 280 characters are rejected (logged as error, not posted).
- Thread tweets are each checked for 280 char limit individually.
- Empty folders are silently skipped.
- The cron checks every 15 minutes, so posts go out within 0-15 min of the scheduled time.
XQueue
基于文件系统的X(Twitter)定时发帖工具。你的文件系统就是操作界面。
工作原理
创建包含日期和时间的文件夹结构。将推文文件放入对应时间段。通过cron任务每15分钟检查一次——如果时间匹配且有内容,则自动发布并清理。
xqueue/
config.json
backlog/
ebook-launch-thread.md
ai-tools-roundup.md
Sunday/
10am/
my-tweet.md
photo.jpg
Monday/
9am/
thread-about-shipping.md
12pm/
5pm/
Tuesday/
...
日程按周循环。周一上午9点的时段会在每周一上午9点触发。如果文件夹为空,则从backlog/中提取最早的文件(按字母顺序排序)。如果时段内有内容,则优先发布该内容,backlog等待。这意味着你可以安排一周的特定内容,并将其他内容放入backlog——它会自动填充空时段。
发布后,文件会被删除(默认设置),避免重复发布。
设置
运行设置命令创建你的队列:
bash
python3 xqueue-setup.py
该命令会询问:
- 1. 每天想发布几次?
- 什么时间发布?(或让它选择最佳时间)
- 时区是什么?
- 是否要发布到X社区?
- 线程分隔符偏好(默认:---)
- 发布后是否删除?(推荐是——如果关闭,推文可能发送两次)
创建完整的文件夹结构 + config.json。
推文格式
简单推文
直接在.md或.txt文件中写入文本:
这是我的推文。最多280个字符。
带社区的推文
在第一行以Post to [社区名称]:开头:
Post to Build in Public: 刚刚发布了我的第一个ClawHub技能。基于文件的推文调度器,无需前端。
线程
一个文件,推文之间用配置的分隔符(默认---)分隔:
我构建了一个无需前端的基于文件的推文调度器。你的文件系统就是操作界面。
将.md文件放入Monday/9am/,cron任务会自动发布。空时段?它会自动从backlog/文件夹中提取内容。
没有数据库,没有应用,没有仪表盘。只有文件夹和文本文件。有时最简单的架构就是最好的。
带媒体的推文
将图片/视频文件放在与推文相同的时间文件夹中。支持:JPG、PNG、GIF(图片小于5MB,GIF小于15MB)。
9am/
tweet.md ← 文本内容
progress.png ← 附加图片
如果存在多个媒体文件,它们将按字母顺序附加(每条推文最多4个)。
配置
xqueue/config.json:
json
{
timezone: America/Chicago,
separator: ---,
deleteAfterPost: true,
communities: {
Build in Public: community_id,
Indie Hackers: community_id
},
logFile: xqueue/posted.log,
dryRun: false
}
在设置过程中,粘贴社区URL(如x.com/i/communities/123456)或直接粘贴数字ID。脚本会提取ID并要求提供显示名称。没有ID的纯名称会被拒绝——发布所需的一切信息都会提前捕获。
Backlog
xqueue/backlog/文件夹存放未安排到特定时段的推文。当cron触发且某个时段为空时,它会从backlog中提取最早的文件(按字母顺序排序——可以使用数字前缀如01-、02-来控制顺序)。
这让你可以批量编写内容,而无需担心恰好放入正确数量的每周时段。安排有时效性的内容,其余放入backlog。
Cron集成
该技能包含一个每15分钟运行一次的cron任务:
- - 检查当前日期+时间与文件夹结构的匹配
- 如果时段有内容→发布
- 如果时段为空→从backlog/中提取最早的内容
- 如果两者都为空→跳过
- 将结果记录到posted.log
- 删除已发布的文件(如果deleteAfterPost开启)
内容放置指南
| 你想... | 这样做 |
|---|
| 安排周二上午9点的推文 | 将.md文件放入xqueue/Tuesday/9am/ |
| 发布线程 |
一个.md文件,推文之间用---分隔 |
| 附加图片 | 将图片文件放在与.md文件相同的文件夹中 |
| 发布到社区 | 以Post to 社区名称:开头 |
| 重新排序推文 | 在时间文件夹之间移动文件 |
| 跳过某个时段 | 让文件夹保持为空 |
| 查看已排队的推文 | 浏览xqueue文件夹 |
| 查看已发布的推文 | 检查xqueue/posted.log |
| 添加无特定时间的待发内容 | 放入xqueue/backlog/ |
| 控制backlog顺序 | 文件名前缀:01-first.md、02-second.md |
重要提示
- - deleteAfterPost: true(默认)意味着每个文件发布一次后即被删除。如果关闭此选项,相同内容将在下周周期重复时再次发布。
- 超过280字符的推文会被拒绝(记录为错误,不发布)。
- 线程中的每条推文都会单独检查280字符限制。
- 空文件夹会被静默跳过。
- cron每15分钟检查一次,因此推文会在计划时间的0-15分钟内发布。