Mixtiles Monthly Pipeline
Automatically collect the best family photos from a WhatsApp group each month, curate them, and generate a ready-to-order Mixtiles cart link.
Configuration
These environment variables control the pipeline. Set them before running:
| Variable | Description | Default |
|---|
| INLINECODE0 | WhatsApp group JID to collect photos from | (required) |
| INLINECODE1 |
Where to send the cart link (group JID or phone number) | Same as
MIXTILES_GROUP_JID |
|
MIXTILES_PHOTO_COUNT | How many photos to select |
4 |
|
MIXTILES_TILE_SIZE | Tile size for the order |
RECTANGLE_12X16 |
Pipeline Steps
Step 1: Collect Photos
Calculate the date range for last month and download all photos from the group:
CODEBLOCK0
The script outputs a JSON manifest on stdout with {id, sender, timestamp, filepath} for each downloaded photo.
Step 2: Curate with Vision
Read each downloaded photo using your vision capability. For each photo, evaluate:
Include if:
- - Real family/life moment (people, gatherings, milestones, kids, travel, pets)
- Good image quality (clear, well-lit, in focus)
- Unique scene (not a near-duplicate of another photo)
Exclude if:
- - Screenshot, meme, forwarded image, or link preview
- Blurry, too dark, or very low quality
- Near-duplicate of a better version already selected
- Text-heavy image (WhatsApp forwards, news articles)
- Promotional content or ads
Step 3: Select Top Photos
From the curated set, pick the top $MIXTILES_PHOTO_COUNT photos (default: 4). Prioritize:
- 1. People and faces (especially kids, family gatherings)
- Milestone moments (birthdays, first steps, graduations)
- Travel and experiences
- Variety — don't pick 4 photos from the same event if there are others
If fewer than $MIXTILES_PHOTO_COUNT good photos exist, use whatever passes curation.
Step 4: Build Multi-Photo Cart
Use the mixtiles-it skill's script with the --batch flag:
CODEBLOCK1
This uploads each photo to Cloudinary and outputs a single Mixtiles cart URL with all photos.
Step 5: Send the Link
Send the cart link to the target chat:
CODEBLOCK2
Error Handling
- - If
collect-photos.sh finds 0 photos: report that no images were found for the period and skip the pipeline. - If fewer photos pass curation than
MIXTILES_PHOTO_COUNT: use all that passed — even 1 photo is worth sending. - If Cloudinary upload fails for a photo: skip that photo, continue with the rest.
- If
wacli send fails: print the cart URL so the user can send it manually.
Manual Trigger
To run the pipeline outside the monthly schedule:
Run the mixtiles-monthly skill: collect photos from the family group for the past month, curate the best ones, build a multi-photo cart link, and send it.
Mixtiles 月度流水线
每月自动从 WhatsApp 群组中收集最佳家庭照片,进行筛选,并生成可直接下单的 Mixtiles 购物车链接。
配置
以下环境变量控制流水线运行。请在运行前设置:
| 变量 | 描述 | 默认值 |
|---|
| MIXTILESGROUPJID | 用于收集照片的 WhatsApp 群组 JID | (必填) |
| MIXTILESSENDTO |
购物车链接的发送目标(群组 JID 或手机号) | 与 MIXTILES
GROUPJID 相同 |
| MIXTILES
PHOTOCOUNT | 选择照片的数量 | 4 |
| MIXTILES
TILESIZE | 订单的瓷砖尺寸 | RECTANGLE_12X16 |
流水线步骤
步骤 1:收集照片
计算上个月的日期范围,并从群组下载所有照片:
bash
计算上个月的第一天
YEAR_MONTH=$(date -v-1m +%Y-%m) # macOS
AFTER
DATE=${YEARMONTH}-01
OUTPUT
DIR=~/mixtiles-queue/${YEARMONTH}
运行收集脚本
bash
/scripts/collect-photos.sh $MIXTILESGROUPJID $AFTERDATE $OUTPUTDIR
该脚本会在标准输出中输出一个 JSON 清单,包含每张下载照片的 {id, sender, timestamp, filepath}。
步骤 2:使用视觉能力筛选
利用你的视觉能力读取每张下载的照片。对每张照片进行评估:
包含条件:
- - 真实的家庭/生活瞬间(人物、聚会、里程碑、孩子、旅行、宠物)
- 良好的图像质量(清晰、光线充足、对焦准确)
- 独特的场景(不是其他照片的近似重复)
排除条件:
- - 截图、表情包、转发图片或链接预览
- 模糊、过暗或质量极低
- 与已选中的更好版本近似重复
- 文字过多的图片(WhatsApp 转发、新闻文章)
- 推广内容或广告
步骤 3:选择最佳照片
从筛选后的照片集中,选出前 $MIXTILESPHOTOCOUNT 张照片(默认:4 张)。优先级排序:
- 1. 人物和面部(尤其是孩子、家庭聚会)
- 里程碑时刻(生日、第一步、毕业典礼)
- 旅行和经历
- 多样性——如果还有其他照片,不要从同一事件中选择 4 张
如果通过筛选的好照片少于 $MIXTILESPHOTOCOUNT 张,则使用所有通过筛选的照片。
步骤 4:构建多照片购物车
使用 mixtiles-it 技能的脚本,并添加 --batch 标志:
bash
MIXTILESCARTSCRIPT=$(find ~/.openclaw/workspace/skills/mixtiles-it/scripts -name mixtiles-cart.py)
python3 $MIXTILESCARTSCRIPT \
--batch \
--size ${MIXTILESTILESIZE:-RECTANGLE_12X16}
此操作将每张照片上传到 Cloudinary,并输出一个包含所有照片的 Mixtiles 购物车 URL。
步骤 5:发送链接
将购物车链接发送到目标聊天:
bash
SENDTO=${MIXTILESSENDTO:-$MIXTILESGROUP_JID}
wacli send text \
--to $SEND_TO \
--message 您的月度瓷砖已准备就绪!以下是上个月的最佳 ${MIXTILESPHOTOCOUNT:-4} 张照片。点击定制并下单:$CART_URL
错误处理
- - 如果 collect-photos.sh 找到 0 张照片:报告该时间段内未找到任何图片,并跳过流水线。
- 如果通过筛选的照片少于 MIXTILESPHOTOCOUNT:使用所有通过筛选的照片——即使只有 1 张也值得发送。
- 如果某张照片的 Cloudinary 上传失败:跳过该照片,继续处理其余照片。
- 如果 wacli send 失败:打印购物车 URL,以便用户手动发送。
手动触发
如需在月度计划之外运行流水线:
运行 mixtiles-monthly 技能:从家庭群组收集过去一个月的照片,筛选最佳照片,构建多照片购物车链接,并发送。