Skip to content
Funghi88Public

About

Score content with Jonah Berger's STEPPS. Trend search, viral videos, video-to-text. EN + 中文.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ViralLab

Engineer your influence. Turn noise into viral.

Try it live →

ViralLab is an end-to-end bilingual (EN / ZH) intelligence, crawling, rewriting, and publishing workbench for content creators. It combines a 3-layer crawler (public APIs/RSS + any-URL open-web reader + optional local OpenCLI on ego lite for login-walled social platforms) with Jonah Berger's STEPPS scoring, Minto Pyramid rewriting (+ optional LLM AI Polish), persistent SQLite crawl history, and 5-channel publishing.


Core Workflow: Spot → Rewrite → Publish

  1. Daily News & AI Authority (/daily) — Global news digest (EN & ZH kept strictly separated) plus a founder-grade AI Authority Brief auto-tagged into 4 strategic layers (Research, Industry, Investment, Strategy & Society).
    • Global EN sources (40+ verified feeds): BBC World & Tech, NPR World & Tech, The Guardian, Al Jazeera, Deutsche Welle (DW), France 24, CNA Singapore, South China Morning Post, The Japan Times, ABC News Australia, Financial Times, Semafor, New York Times Tech, CNBC, TechCrunch, The Verge, Wired, Ars Technica, MIT Technology Review, Axios, Rest of World, OpenAI Blog, Google AI & DeepMind Blogs, Hugging Face, BAIR, Simon Willison, Hacker News, and Google News.
    • Chinese ZH sources (17+ verified feeds): 量子位, IT之家, 爱范儿, 少数派, Solidot, 开源中国, 人人都是产品经理, 创业邦, 德国之声中文, 法广中文 RFI, plus targeted signals from 机器之心, DeepTech, 甲子光年, 阿里研究院, and 新智元.
  2. News by Topic (/news) — Search any topic in English or Chinese with live auto-refreshing background search, platform hot-topic discovery (HN, Lobste.rs, Dev.to, GitHub, Bilibili, Weibo/Zhihu/Douyin/Baidu/PTT), and field-heat breakdowns.
  3. Long-form & Podcasts (/longform) — Curated essays and top podcasts (The Atlantic, The New Yorker, The Economist, Stratechery, Pragmatic Engineer, Hard Fork, Acquired, Lenny's Podcast, FT中文网, 纽约时报中文网, 報導者, 端傳媒, 阮一峰的网络日志, UX Coffee, etc.).
  4. Viral Videos & Social Discovery (/viral, /china-content) — Instant cached trending videos for Global (YouTube) and China (Bilibili) plus on-demand multi-platform search for Xiaohongshu, Douyin, Zhihu, Weibo, Xiaoyuzhou, Shipinhao, X, Reddit, TikTok, and Instagram via OpenCLI on ego lite (with automatic Playwright fallback). Every crawled item is saved & deduplicated in SQLite (output/virallab.db) with ⭐ bookmarks, Berger STEPPS scores, and 1-click ✍️ Rewrite / 🚀 Publish handoff.
  5. Video / Audio to Text + Image OCR (/video-to-text) — Paste a YouTube/Bilibili/Douyin/XHS/podcast URL or local media path to extract transcripts (YouTube captions → yt-dlp → VideoCaptioner / optional WhisperX) with STEPPS + Minto analysis. Also supports YouTube video/audio downloads and offline Chinese/Latin Image OCR via RapidOCR + ONNX.
  6. 1-Click Rewrite (/article-lab) — Every card on /daily, /news, /longform, and /china-content has ✍️ Rewrite and 🚀 Publish buttons. Paste any open-web URL (Tier 2 Web Reader), upload .md files, or edit transcripts into conclusion-first Minto Pyramid drafts with full STEPPS diagnosis — works rule-based with no keys, or enable ✨ AI Polish (LLM) using your configured OpenAI / Anthropic / Gemini key.
  7. 5-Channel Publish Hub & Scheduler (/publish) — Queue, schedule (auto-dispatched every minute by APScheduler), format, and publish directly to:
    • Personal Blog (GitHub Pages / Jekyll) — Native Jekyll frontmatter (layout: post, title, date, category, excerpt) committed directly to _posts/ or _drafts/ via GitHub API (preconfigured for Funghi88/funghi88.github.io), or 1-click Copy Jekyll .md.
    • Telegram — Direct Bot API HTML publishing with automatic chunking for long posts.
    • WeChat 公众号 — Direct Draft Box API (draft/add) + 1-click Copy WeChat Rich HTML (inline-styled HTML that pastes cleanly into mp.weixin.qq.com with zero keys required).
    • Xiaohongshu 小红书 — Native mobile formatter (≤20-char hook title, emoji paragraphs, #tags) + 1-click Copy & Open Creator Studio + optional webhook.
    • X (Twitter) — Direct X API v2 OAuth 1.0a publishing (with automatic numbered multi-tweet threads) + webhook fallback + 1-click Copy Thread & Open X Composer.

Quick Start (macOS / Linux)

Requires Python 3.12 (recommended) and ffmpeg (for audio/video processing). For optional Tier 3 social crawling, also install Node.js >= 20 and ego lite.

git clone https://github.com/Funghi88/ViralLab.git
cd ViralLab
./scripts/install.sh
./scripts/dev-server.sh

Open http://127.0.0.1:5001 in your browser (recommended: pin it as a tab inside ego lite).

Useful Commands

Task Command
Start local dashboard (auto-reload) ./scripts/dev-server.sh
Refresh all feeds (hot list, daily, longform, videos, topics) .venv/bin/python scripts/refresh_all_content.py
Daily news + AI Authority only .venv/bin/python main.py --daily-news
Search news on a topic .venv/bin/python main.py --search-only "AI agents"
Viral videos (+ optional --transcript) .venv/bin/python main.py --videos "AI explainer" --transcript
Single media URL or local file → transcript .venv/bin/python main.py --video-to-text <url_or_path>
Fetch any open-web URL → clean Markdown .venv/bin/python main.py --read-url <https://...>
Upgrade yt-dlp in .venv ./scripts/upgrade-ytdlp.sh
Run full test suite .venv/bin/python -m unittest discover -s tests

Network & macOS VPN Support

ViralLab's src/proxy_env.py handles macOS VPN environments automatically — no hardcoded proxy ports required:

  • TUN VPN mode (e.g., QuickQ TUN): Detected cleanly as direct/TUN routing with zero dead-port stalls.
  • Floating SOCKS5 / HTTP proxies: Dynamically inspects macOS scutil --proxy (with native PySocks / socksio support) and fast-probes ports before use, adapting automatically whenever your VPN reconnects and changes ports.
  • Domestic vs Overseas routing: China-domestic endpoints (Douyin, XHS short links, WeChat API) bypass overseas proxies automatically.
  • Check live proxy status anytime at GET /api/health.

Configuration (.env)

Copy .env.example to .env. News, long-form, viral videos, OCR, and platform formatters work without any API keys. Add keys only for the optional features you want:

AI-Enhanced Scoring & Rewrites (Optional)

Multi-provider client (src/llm_client.py) tries configured keys in order with automatic fallback:

OPENAI_API_KEY=sk-...             # Default model: gpt-4.1-mini (override: VIRALLAB_OPENAI_MODEL)
ANTHROPIC_API_KEY=sk-ant-...      # Default model: claude-haiku-4-5 (override: VIRALLAB_ANTHROPIC_MODEL)
GEMINI_API_KEY=...                # Default model: gemini-2.5-flash (override: VIRALLAB_GEMINI_MODEL)

5-Channel Live Publishing (Optional)

# Personal Blog (GitHub Pages / Jekyll)
GITHUB_TOKEN=ghp_...
GITHUB_BLOG_REPO=Funghi88/funghi88.github.io
GITHUB_BLOG_BRANCH=main
GITHUB_BLOG_CATEGORY=Writing

# Telegram Channel / Chat
TELEGRAM_BOT_TOKEN=123456789:AA...
TELEGRAM_CHAT_ID=@your_channel

# WeChat Official Account Draft Box (or use 1-click Copy WeChat Rich HTML with no keys)
WECHAT_APP_ID=wx...
WECHAT_APP_SECRET=...
WECHAT_THUMB_MEDIA_ID=...

# X (Twitter) — Direct API v2 (OAuth 1.0a) OR Webhook (n8n / Make / Zapier)
X_API_KEY=...
X_API_SECRET=...
X_ACCESS_TOKEN=...
X_ACCESS_TOKEN_SECRET=...
# X_PUBLISH_WEBHOOK=https://...

# Xiaohongshu (or use 1-click Copy XHS Format with no keys)
# XHS_PUBLISH_WEBHOOK=https://...

Optional Media & Crawlers

  • Douyin → Transcript: Pasting a local downloaded video/audio path is most reliable. For URLs, see config/README-ytdlp-cookies.md.
  • Higher-Quality Local ASR (WhisperX): pip install -r requirements-asr.txt (automatically uses CPU int8 on Apple Silicon to avoid ctranslate2 MPS issues).
  • 3-Layer Crawler (APIs + Open-Web Reader + Optional OpenCLI on ego lite / Playwright):
    • Tier 1 (Public APIs / RSS / Hot Lists): Works out of the box with zero login.
    • Tier 2 (Universal Open-Web URL Reader): Paste any web URL into /article-lab or POST /api/web-read (direct HTML→Markdown + automatic Jina Reader fallback + optional OpenCLI fallback).
    • Tier 3 (Optional OpenCLI on ego lite, local only):
      1. Install OpenCLI globally: npm install -g @jackwener/opencli (requires Node.js >= 20).
      2. Download & unzip opencli-extension-*.zip from jackwener/opencli Releases into ~/.opencli/extension.
      3. Open ego lite → go to chrome://extensions/ → enable Developer mode → click Load unpacked → select ~/.opencli/extension.
      4. Sign into dedicated secondary accounts (小号) inside ego lite for Xiaohongshu / Douyin / Weibo / X.
      5. Verify with opencli doctor (or click "检测 OpenCLI / ego-lite" on /china-content). ViralLab enforces safe defaults: on-demand only (never cron), ≤12 items/query, and 2–4.5s randomized delays.
    • Persistent Crawl History & Bookmarks (output/virallab.db): Every crawled item is saved & deduplicated in SQLite so you can search, filter, ⭐ Star, and 1-click ✍️ Rewrite / 🚀 Publish without re-crawling platforms.
    • Playwright Fallback (XHS / Douyin / Zhihu / Shipinhao / X / Instagram):
      .venv/bin/python -m playwright install chromium
      .venv/bin/python -m tools.china_crawler login --platform xhs
      .venv/bin/python -m tools.china_crawler run --platform xhs --keywords "AI" --engine playwright
  • Automatic Storage Cleanup: src/output_cleanup.py automatically prunes stale raw_*, videos_*, transcript_*, article_rewrite_*, youtube_*, viral_cache_*, handoff_*, and web_read_* artifacts older than OUTPUT_RETENTION_DAYS (default: 3 days) and deletes intermediate yt-dlp fragments after merging.

API Endpoints

  • GET /api/health — Server health, active proxy mode, web reader & OpenCLI install state
  • GET /api/crawler/status — 3-layer crawler diagnostics (Tier 1 APIs, Tier 2 Web Reader, Tier 3 OpenCLI + ego lite bridge)
  • POST /api/web-read — Tier 2 Universal Open-Web URL Reader ({url} → clean Markdown + metadata)
  • GET /api/crawl-history · POST /api/crawl-history/star — Persistent SQLite crawl history, search, and ⭐ bookmarks
  • GET /api/digests · GET /api/digests/<filename> · GET /api/export/<filename>?format=markdown|notion|obsidian
  • GET /api/refresh-daily · GET /api/refresh-ai-authority · GET /api/refresh-videos (supports ?key=CRON_SECRET)
  • POST /api/search-news · GET /api/search-news-status?stem=<stem>
  • GET /api/viral-videos?q=<query>&source=global|china (15-min cache; &refresh=1 to bypass)
  • POST /api/video-to-text · POST /api/youtube-formats · POST /api/youtube-download · POST /api/image-ocr
  • POST /api/china-crawl · POST /api/china-content-evaluate · POST /api/china-content-rewrite
  • POST /api/handoff · POST /api/publish/format

Deploy

Deploy to Render

  1. Connect your GitHub repo on render.com — Render auto-detects render.yaml.
  2. Add any optional API keys (GEMINI_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN, TELEGRAM_BOT_TOKEN, CRON_SECRET).
  3. Optional cron keep-fresh: schedule GET https://<your-app>/api/refresh-daily?key=YOUR_CRON_SECRET.

See DEPLOY.md and CHINA_ACCESS.md for details. (Note: Tier 1 APIs/RSS and Tier 2 Open-Web URL Reader run on both local Mac and Render; Tier 3 OpenCLI + ego lite is local-only.)


Contributors

  • @Funghi88 (Annabelle Lee) — Creator & Maintainer
  • @cursoragent (Cursor Agent) — AI Engineering Contributor
  • Antigravity (Google DeepMind) — AI Engineering Contributor

Tech Stack

Python (Flask, SQLite, Playwright, RapidOCR, WhisperX) · Inline HTML / CSS / JavaScript · Shell scripts (scripts/*.sh) · External optional Node.js CLI (@jackwener/opencli on ego lite)

About

Score content with Jonah Berger's STEPPS. Trend search, viral videos, video-to-text. EN + 中文.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages