SuperAPI AI Directory

ai-content-publisher

General & other

View repository

Updated 10-16 04:59

About this skill

AI Content Automatic Publishing System

Automatically search for the latest AI news, intelligently select topics, generate high-quality articles, and publish them to the WeChat Official Account draft box. The content focuses on high-quality information valuable to AI developers, product managers, and entrepreneurs.

Architecture Description: This system reuses the following skills:

  • wechat-tech-writer: responsible for article content generation
  • wechat-article-formatter: responsible for formatting into WeChat HTML
  • wechat-draft-publisher: responsible for publishing to the draft box

This system focuses on: hotspot acquisition, intelligent topic selection, time strategy, and publishing scheduling.

⚠️ Hard requirement - The cover image must be selected from the cover library:

  • Prohibited to use canvas-design or any other method to generate cover images
  • Must call scripts/select_cover.py to select a cover from the cover library
  • Cover library location:assets/covers/
  • If cover selection fails, the entire publishing process must error out and exit

Core Features

  • Article Mode: Supports standard mode and deep mode
    • Standard Mode(Default): 2000-3000 word popular science article, suitable for daily publishing
    • Deep Mode: 5000-word in-depth analysis, suitable for feature articles
  • Time Period Strategy: Automatically select content type based on publishing time
    • 8 AM: New tool/new model introduction
    • 12 PM: Practical tutorial/tips
    • 6 PM: Industry news/in-depth analysis
  • Intelligent Title Generation: Attractive and realistic, avoiding clickbait
  • 48-hour timeliness check: Ensure the content is the latest
  • Intelligent Filtering: Automatically exclude information useless to developers such as financing and market value
  • 1 article each time: Focus on quality rather than quantity

Target Readers

  • AI Developers: Need to understand the latest tools, technologies, and frameworks
  • AI Product Managers: Need to pay attention to industry trends and product developments
  • AI Entrepreneurs: Need to obtain market insights and competitive analysis
  • AI beginners/aspiring entrants: Need practical tutorials and learning paths

Trigger Conditions

Triggered when the user says phrases similar to the following:

  • "Help me generate today's AI article"
  • "Write today's Official Account content"
  • "AI content automatic publishing"
  • "Generate an AI developer article"
  • "Search for AI news and publish"

Execution Flow

Step 1: Determine the time period and content type

from datetime import datetime
from scripts.title_generator import get_time_slot_type, TIME_SLOT_CONTENT

# 获取当前时间和目标类型
target_type, time_slot = get_time_slot_type()
time_info = TIME_SLOT_CONTENT[time_slot]

print(f"当前时间: {datetime.now().strftime('%H:%M')}")
print(f"时段: {time_slot}")
print(f"内容类型: {time_info['description']}")
print(f"内容重点: {time_info['focus']}")
print(f"目标读者: {time_info['target_audience']}")

Time Period Mapping:

  • 6:00-11:00 → morning → New tool/new model introduction
  • 11:00-16:00 → afternoon → Practical tutorial/tips
  • 16:00-6:00 → evening → Industry news/in-depth analysis

Step 2: Get the current date and obtain hotspots

# 确认当前日期
date_str=$(date +"%Y年%m月%d日")
echo "今天是: $date_str"

# 获取热点
cd /home/ubuntu/.claude/skills/ai-content-publisher
python3 scripts/fetch_hotspots.py

Hotspot Sources:

  • AI company official blogs (OpenAI, Anthropic, DeepMind, Meta AI, Hugging Face, Mistral)
  • Tech media RSS (The Verge AI, VentureBeat AI, TechCrunch AI, MIT Tech Review)
  • GitHub Trending (popular AI/ML projects)

Important: only fetch hot topics within 48 hours to ensure the content is the latest.

Step 3: Intelligent topic selection (select 1 article)

python3 scripts/selector.py

Topic selection strategy:

  1. Determine the target type based on the time period
  2. Filter and exclude: exclude useless information such as financing, market value, personnel changes, etc.
  3. Targeted scoring: prioritize high-scoring topics that match the target type
  4. Choose the best: select only 1 topic with the highest score

Save the selected topic to:cache/selected_topic.json

Step 4: Generate an attractive title

from scripts.title_generator import generate_title

# 读取选中的话题
import json
with open('cache/selected_topic.json', 'r') as f:
    topic = json.load(f)

# 生成标题(会根据内容类型自动选择合适的模板)
generated_title = generate_title(topic, topic['content_type'])

print(f"生成标题: {generated_title}")

Title generation principles:

  • ✅ Include specific numbers ("3 tips", "done in 5 steps")
  • ✅ Direct benefit point ("boost your efficiency 10x")
  • ✅ Clear and specific (not vague)
  • ✅ Appropriate length (avoid being truncated)
  • ✅ Realistic (title matches content)
  • ❌ Avoid clickbait ("Shocking!", "Must-read!", etc.)

Step 5: Generate article content

Use wechat-tech-writer the generate.py script to generate the article:

# 标准模式(默认)
python3 /home/ubuntu/wechat_article_skills/wechat-tech-writer/generate.py \
  --topic "$TOPIC_TITLE" \
  --url "$TOPIC_URL" \
  --type "$CONTENT_TYPE" \
  --output "$OUTPUT_DIR" \
  --mode standard

# 深度模式(5000字专题文章)
python3 /home/ubuntu/wechat_article_skills/wechat-tech-writer/generate.py \
  --topic "$TOPIC_TITLE" \
  --url "$TOPIC_URL" \
  --type "$CONTENT_TYPE" \
  --output "$OUTPUT_DIR" \
  --mode deep

Mode description:

  • standard: 2000-3000 words, standard popular science article (used by scheduled tasks)
  • deep: 5000 words, in-depth analysis article (used when manually triggering special requirements)

Save the generated article to:

output/{日期}/article/
├── article.md

Step 5.5: Select a cover image from the cover library (⚠️ mandatory requirement)

# 根据内容类型从封面库选择封面
python3 scripts/select_cover.py "$CONTENT_TYPE" "output/{日期}/article/"

Cover selection rules:

  • new_tool → tool_*.png(blue AI tools, dark coding, orange productivity)
  • tutorial → tutorial_*.png(green learning)
  • industry_news → news_*.png(blue data, purple analysis)

Copy the cover as:output/{日期}/article/cover.png

⚠️ Strictly prohibited:

  • Prohibited to use /canvas-design to generate covers
  • Prohibited to use any AI-generated cover
  • If select_cover.py fails, must report an error and exit

Step 6: Format HTML

Use wechat-article-formatter to convert:

python3 /home/ubuntu/.claude/skills/wechat-article-formatter/convert.py \
  --input output/{日期}/article/article.md \
  --theme tech \
  --output output/{日期}/article/article_wechat.html

Step 7: Publish to drafts

Use wechat-draft-publisher to publish:

python3 /home/ubuntu/.claude/skills/wechat-draft-publisher/publisher.py \
  --title "{文章标题}" \
  --content output/{日期}/article/article_wechat.html \
  --cover output/{日期}/article/cover.png \
  --author "阳桃AI干货"

Step 8: Publish to Xiaohongshu (newly added)

Use xiaohongshu-publisher to publish the condensed version:

# 1. 复制封面图到Docker挂载目录
cp output/{日期}/article/cover.png /home/ubuntu/xiaohongshu-mcp/docker/images/xhs_cover_{日期}.png

# 2. 通过API发布到小红书
curl -s -X POST http://localhost:18060/api/v1/publish \
  -H "Content-Type: application/json" \
  -d '{
    "title": "{压缩标题(≤20字)}",
    "content": "{精简正文(≤1000字,保留核心要点)}",
    "images": ["/app/images/xhs_cover_{日期}.png"],
    "tags": ["AI", "编程工具"]
  }'

Content condensation rules:

  • Title: ≤20 characters (extract keywords from the WeChat title)
  • Body: ≤1000 characters (extract 3-5 core points)
  • Style: use emoji, short sentences, list format
  • Interaction: add a call to action at the end ("welcome to comment, like, and save")

Note: the Docker service must run on http://localhost:18060

Step 9: Complete summary

✅ AI内容生成完成(双平台发布)

生成时间:{当前时间}
内容类型:{类型}

【微信公众号】
标题:{完整标题}
字数:{字数}字
状态:已发布到草稿箱
Media ID:{media_id}

【小红书】
标题:{压缩标题}
字数:{压缩字数}字
状态:已发布
链接:小红书App查看

---
请前往微信公众号后台查看草稿:
https://mp.weixin.qq.com

Title writing reference

Elements of a good title

Element Description Example
Specific numbers "3 tips", "done in 5 steps" "Build an AI app with LangChain in 3 steps"
Direct benefit "Make... improve efficiency..." "Claude Code: Making Developers 3x More Efficient"
Clear and specific Not vague, targeted "OpenAI o3: 3 Changes AI Developers Need to Know"
Appropriate length Avoid being truncated WeChat limit is 64 bytes (about 20 Chinese characters)
Realistic Title matches content Not exaggerated, not vague

Title templates

Tool introduction type:

  • {工具名}:让{benefit}的AI助手
  • 发布!{工具名},{core_feature}
  • {tool_name}:{benefit}的完整指南

Tutorial type:

  • {action}:用{tool}实现{goal}
  • {number}步教你{action}(附代码)
  • 手把手教你:用{tool}{action}

Industry news type:

  • {event}:{impact}需要知道的事
  • {event}发布,{target_audience}如何应对
  • 解读{event}:{core_change}

Tips summary type:

  • {number}个{skill}技巧,让{benefit}
  • 提升{skill}的{number}个方法
  • {skill}进阶:{number}个实用技巧

Avoid clickbait

❌ Do not use:

  • "Shocking!", "Must-read!", "Stunned!"
  • "You absolutely won't believe..."
  • Overpromising
  • Deliberately vague

✅ Should use:

  • Be realistic
  • Highlight value
  • Clear and specific
  • Moderately appealing

Configuration file

config/sources.yaml

  • RSS feed list
  • GitHub configuration
  • Timeliness setting (48 hours)
  • Limit on the number fetched each time

Output directory

output/
└── {日期}/
    └── article/
        ├── article.md           # 原始文章
        ├── cover.png            # 封面图(从封面库选择,⚠️ 禁止生成)
        └── article_wechat.html  # 微信HTML格式

cache/ ├── hotspots.json # Raw hotspots └── selected_topic.json # Selected topic (single)


## 定时任务配置

### Crontab 配置

```bash
# 编辑定时任务
crontab -e

# 添加以下内容(早8点、中午12点、晚上6点)
0 8,12,18 * * * cd /home/ubuntu && claude skill ai-content-publisher >> /var/log/ai-content.log 2>&1

Cron expression explanation

┌───────────── 分钟 (0-59)
│  ┌────────── 小时 (0-23)
│  │   ┌────── 日期 (1-31)
│  │   │  ┌─── 月份 (1-12)
│  │   │  │ ┌ 星期 (0-7)
│  │   │  │ │
*  *  *  *  *  命令
  • 0 8,12,18 * * * = Run every day at 8:00, 12:00, and 18:00
  • >> /var/log/ai-content.log = Append logs to file
  • 2>&1 = Redirect errors to log as well

Quality standards

Content quality requirements

  • Originality: Reorganize in your own words, do not copy the original text
  • Accuracy: Facts and data must be reliable
  • Practicality: Must have concrete value and be helpful to readers
  • Readability: Language should be natural and fluent, suitable for WeChat official account style
  • Word count requirement: 2000-3000 characters

Title quality requirements

  • Length limit: No more than 64 bytes (about 20 Chinese characters)
  • Appeal: Make people want to click, but not exaggerate
  • Information value: Include core information so readers know what they will learn
  • Match: Title and content must be completely consistent

Notes

  1. ⚠️ Mandatory cover image requirement:

    • MustChoose from the cover library (assets/covers/)
    • ProhibitedUse /canvas-design to generate cover
    • ProhibitedUse any AI-generated cover
    • If cover selection fails, report an error and exit; do not continue publishing
  2. Date check: The current date must be confirmed before all search operations

  3. Timeliness: Only use hotspots within 48 hours

  4. Time period strategy: Automatically select the appropriate content type based on the time

  5. Quality first: Better to publish less than to compromise quality

  6. Title standards: Attractive but not clickbait

  7. Publish to Drafts: Save to drafts first; users can manually review before officially publishing

Reference Resources

Title Writing Techniques