首页/数据 & AI/last30days-skill
L

last30days-skill

by @mvanhornv
4.6(766)

这是一个AI代理技能,能深度研究过去30天内Reddit、X、YouTube等10+来源的任何主题,并由AI综合生成有依据、带引用的报告。适用于快速了解最新趋势和热点。

ai-researchmulti-sourcetrend-analysissocial-media-analysiscited-reportsGitHub
安装方式
npx skills add mvanhorn/last30days-skill --skill last30days
compare_arrows

Before / After 效果对比

1
使用前

手动在Reddit、X、YouTube等平台逐一搜索信息,耗时数小时甚至数天,难以整合和验证。

使用后

AI代理自动抓取并综合多源数据,数分钟内生成带引用报告,大幅提升研究速度和报告质量。

SKILL.md

last30days v2.9.5: Research Any Topic from the Last 30 Days

Permissions overview: Reads public web/platform data and optionally saves research briefings to ~/Documents/Last30Days/. X/Twitter search uses optional user-provided tokens (AUTH_TOKEN/CT0 env vars). Bluesky search uses optional app password (BSKY_HANDLE/BSKY_APP_PASSWORD env vars - create at bsky.app/settings/app-passwords). All credential usage and data writes are documented in the Security & Permissions section.

Research ANY topic across Reddit, X, YouTube, and other sources. Surface what people are actually discussing, recommending, betting on, and debating right now.

Step 0: First-Run Setup Wizard

CRITICAL: ALWAYS execute Step 0 BEFORE Step 1, even if the user provided a topic. If the user typed /last30days Mercer Island, you MUST check for FIRST_RUN and present the wizard BEFORE running research. The topic "Mercer Island" is preserved — research runs immediately after the wizard completes. Do NOT skip the wizard because a topic was provided. The wizard takes 10 seconds and only runs once ever.

To detect first run: check if ~/.config/last30days/.env exists. If it does NOT exist, this is a first run. Do NOT run any Bash commands or show any command output to detect this — just check the file existence silently. If the file exists and contains SETUP_COMPLETE=true, skip this section and proceed to Step 1.

When first run is detected, you MUST follow these steps IN ORDER. Do NOT skip ahead to the topic picker or research. The sequence is: (1) welcome text → (2) setup modal → (3) run setup if chosen → (4) ScrapeCreators modal → (5) topic picker. You MUST start at step 1.

Step 1: Display the following welcome text ONCE as a normal message (not blockquoted). Then IMMEDIATELY call AskUserQuestion — do NOT repeat any of the welcome text inside the AskUserQuestion call.

👋 Welcome to /last30days!

I research any topic across Reddit, X, YouTube, and other sources — synthesizing what people are actually saying right now.

To get the best results, I can: 🔍 Scan your browser for X/Twitter cookies (free X search — reads x.com only, never saved) 📺 Install yt-dlp for YouTube search + transcripts (free, open source, 190K+ GitHub stars) ⭐ ScrapeCreators API key unlocks Reddit comments + TikTok + Instagram (100 free to start — scrapecreators.com)

We recommend all 3 before your first run — it's what makes the magic. More community sources available later. We get no kickbacks from any of these.

Then call AskUserQuestion with ONLY this question and these options — no additional text:

Question: "How would you like to set up?" Options:

  • "Auto setup (~30 seconds) — scans browser for X cookies (free X search) and installs yt-dlp (free YouTube transcripts)"
  • "Manual setup — show me what to configure"
  • "Skip for now — Reddit (threads only), HN, Polymarket, Web"

If the user picks 1 (Auto setup): Run the setup subcommand:

cd {SKILL_DIR} && python3 scripts/last30days.py setup

Show the user the results (what cookies were found, whether yt-dlp was installed).

Then show the ScrapeCreators push (plain text, then modal):

⭐ One more thing — Reddit comments are some of the best content on the internet. The top-voted replies often have sharper insights than the posts themselves. ScrapeCreators unlocks these (plus TikTok + Instagram) — 100 free to start, no credit card.

Call AskUserQuestion: Question: "Want to add Reddit comments to your research?" Options:

  • "Open scrapecreators.com to get my free key" — run open https://scrapecreators.com via Bash to open in the user's browser. Then ask them to paste the API key they get. When they paste it, write SCRAPECREATORS_API_KEY={key} to ~/.config/last30days/.env
  • "I have a key — let me paste it" — accept the key, write to .env
  • "Skip for now — start researching" — proceed without ScrapeCreators

After SC key is saved (not if skipped), show the TikTok/Instagram opt-in:

Your ScrapeCreators key also powers TikTok and Instagram search. Want those on for every research run? (Each additional source uses a ScrapeCreators call per search.)

Call AskUserQuestion: Question: "Also search TikTok and Instagram?" Options:

  • "Yes, search everything — TikTok + Instagram on every run" — append INCLUDE_SOURCES=tiktok,instagram to ~/.config/last30days/.env. Confirm: "All set — Reddit comments, TikTok, and Instagram will run on every search."
  • "Just Reddit comments for now" — don't write the flag. Confirm: "Got it — Reddit comments are on. TikTok and Instagram will kick in automatically for relevant topics like product reviews and trends. Add INCLUDE_SOURCES=tiktok,instagram to your .env anytime to force them on."

After TikTok/Instagram opt-in (or SC skip), show the first research topic modal:

Call AskUserQuestion: Question: "What do you want to research first?" Options:

  • "Claude Code vs Codex" — tech comparison
  • "Sam Altman" — person in the news
  • "Warriors Basketball" — sports
  • "AI Legal Prompting Techniques" — niche/professional
  • "Type my own topic"

If user picks an example, run research with that topic. If they pick "Type my own", ask them what they want to research. If the user originally provided a topic with the command (e.g., /last30days Mercer Island), skip this modal and use their topic directly.

END OF FIRST-RUN WIZARD. Everything above in Step 0 ONLY runs on first run. If SETUP_COMPLETE=true exists in .env, skip ALL of Step 0 — no welcome, no setup, no ScrapeCreators modal, no topic picker. Go directly to Step 1 (Parse User Intent). The topic picker is ONLY for first-time users who haven't run /last30days before.

If the user picks 2 (Manual setup): Show them this guide (present as plain text, not blockquoted):

The magic of /last30days is Reddit comments + X posts together. Here's how to unlock each source.

Add these to ~/.config/last30days/.env:

🔍 X/Twitter (pick one — this is the most important):

  • FROM_BROWSER=auto — easiest, free. Scans your browser cookies for x.com login.
  • AUTH_TOKEN=xxx + CT0=xxx — paste your X cookies manually (x.com → F12 → Application → Cookies)
  • XAI_API_KEY=xxx — use an xAI/Grok API key instead (api.x.ai)

⭐ Reddit Comments + TikTok + Instagram + YouTube backup (one key, 5 platforms):

  • SCRAPECREATORS_API_KEY=xxx — 100 free to start at scrapecreators.com. This is the single most impactful key — Reddit comments are where the sharpest insights live.

💡 Reddit discovery fallback (optional):

  • OPENAI_API_KEY=xxx — ChatGPT web search for Reddit threads. Only used if ScrapeCreators isn't configured — SC is better.

📺 YouTube (primary engine):

  • Run brew install yt-dlp — free, open source. ScrapeCreators covers YouTube as backup if you skip this.

Bonus sources (add anytime):

  • EXA_API_KEY=xxx — semantic web search, 1K free/month (exa.ai)
  • BSKY_HANDLE=you.bsky.social + BSKY_APP_PASSWORD=xxx — Bluesky (free app password)
  • BRAVE_API_KEY=xxx — Brave web search
  • OPENROUTER_API_KEY=xxx — Perplexity Sonar Pro search

Always add this last line: SETUP_COMPLETE=true

You can paste your API keys right here and I'll write the file for you. Some people say giving LLMs your keys is risky, others live in YOLO mode. Your call.

If the user pastes keys, write them to ~/.config/last30days/.env (create the file and parent dirs if needed, append without overwriting existing keys, always include SETUP_COMPLETE=true). Then proceed with research.

If the user says they'll do it themselves, tell them: "Save the file, then run /last30days <topic> to research anything." Then proceed with research using whatever sources are currently available.

If the user picks Skip: Proceed with research immediately using the user's original topic. Note: without setup, sources are limited to Reddit (threads only, no comments), HN, and Polymarket. X/Twitter and YouTube require setup.


Do I Need API Keys?

When users ask about API keys, setup, or how to unlock more sources, reference this:

You do NOT need API keys to use last30days. It works out of the box with Reddit (threads only, no comments), Hacker News, and Polymarket. Browser cookies for X/Twitter are equivalent to an API key — just log into x.com in any browser and last30days will find your session automatically.

Source unlock progression (all free except ScrapeCreators):

  • Zero config (40% quality): Reddit (threads only, no comments), HN, Polymarket — works immediately
  • + X cookies (60%): Log into x.com in any browser. last30days scans your cookies automatically. This is the same as having an API key — no signup required.
  • + yt-dlp (80%): brew install yt-dlp — open source, 190K+ GitHub stars. Enables YouTube search and transcripts.
  • + ScrapeCreators (100%): The only paid option worth mentioning. Unlocks Reddit with full comments (the most valuable research content), TikTok, and Instagram. 100 free API calls, no credit card — scrapecreators.com

Key comparison: X browser cookies = same access as an API key (free, no signup). ScrapeCreators is the only service worth paying for (and the free tier is generous).

last30days has no affiliation with any API provider — no referrals, no kickbacks.


CRITICAL: Parse User Intent

Before doing anything, parse the user's input for:

  1. TOPIC: What they want to learn about (e.g., "web app mockups", "Claude Code skills", "image generation")
  2. TARGET TOOL (if specified): Where they'll use the prompts (e.g., "Nano Banana Pro", "ChatGPT", "Midjourney")
  3. QUERY TYPE: What kind of research they want:
    • PROMPTING - "X prompts", "prompting for X", "X best practices" → User wants to learn techniques and get copy-paste prompts
    • RECOMMENDATIONS - "best X", "top X", "what X should I use", "recommended X" → User wants a LIST of specific things
    • NEWS - "what's happening with X", "X news", "latest on X" → User wants current events/updates
    • COMPARISON - "X vs Y", "X versus Y", "compare X and Y", "X or Y which is better" → User wants a side-by-side comparison
    • GENERAL - anything else → User wants broad understanding of the topic

Common patterns:

  • [topic] for [tool] → "web mockups for Nano Banana Pro" → TOOL IS SPECIFIED
  • [topic] prompts for [tool] → "UI design prompts for Midjourney" → TOOL IS SPECIFIED
  • Just [topic] → "iOS design mockups" → TOOL NOT SPECIFIED, that's OK
  • "best [topic]" or "top [topic]" → QUERY_TYPE = RECOMMENDATIONS
  • "what are the best [topic]" → QUERY_TYPE = RECOMMENDATIONS
  • "X vs Y" or "X versus Y" → QUERY_TYPE = COMPARISON, TOPIC_A = X, TOPIC_B = Y (split on vs or versus with spaces)

IMPORTANT: Do NOT ask about target tool before research.

  • If tool is specified in the query, use it
  • If tool is NOT specified, run research first, then ask AFTER showing results

Store these variables:

  • TOPIC = [extracted topic]
  • TARGET_TOOL = [extracted tool, or "unknown" if not specified]
  • QUERY_TYPE = [RECOMMENDATIONS | NEWS | HOW-TO | COMPARISON | GENERAL]
  • TOPIC_A = [first item] (only if COMPARISON)
  • TOPIC_B = [second item] (only if COMPARISON)

DISPLAY your parsing to the user. Before running any tools, output:

I'll research {TOPIC} across Reddit, X, YouTube, and other sources to find what's been discussed in the last 30 days.

Parsed intent:
- TOPIC = {TOPIC}
- TARGET_TOOL = {TARGET_TOOL or "unknown"}
- QUERY_TYPE = {QUERY_TYPE}

Research typically takes 2-8 minutes (niche topics take longer). Starting now.

If TARGET_TOOL is known, mention it in the intro: "...to find {QUERY_TYPE}-style content for use in {TARGET_TOOL}."

This text MUST appear before you call any tools. It confirms to the user that you understood their request.


Step 0.5: Resolve X Handle (if topic could have an X account)

If TOPIC looks like it could have its own X/Twitter account - people, creators, brands, products, tools, companies, communities (e.g., "Dor Brothers", "Jason Calacanis", "Nano Banana Pro", "Seedance", "Midjourney"), do ONE quick WebSearch:

WebSearch("{TOPIC} X twitter handle site:x.com")

From the results, extract their X/Twitter handle. Look for:

  • Verified profile URLs like x.com/{handle} or twitter.com/{handle}
  • Mentions like "@handle" in bios, articles, or social profiles
  • "Follow @handle on X" patterns

Verify the account is real, not a parody/fan account. Check for:

  • Verified/blue checkmark in the search results
  • Official website linking to the X account
  • Consistent naming (e.g., @thedorbrothers for "The Dor Brothers", not @DorBrosFan)
  • If results only show fan/parody/news accounts (not the entity's own account), skip - the entity may not have an X presence

If you find a clear, verified handle, pass it as --x-handle={handle} (without @). This searches that account's posts directly - finding content they posted that doesn't mention their own name.

Skip this step if:

  • TOPIC is clearly a generic concept, not an entity (e.g., "best rap songs 2026", "how to use Docker", "AI ethics debate")
  • TOPIC already contains @ (user provided the handle directly)
  • Using --quick depth
  • WebSearch shows no official X account exists for this entity

Store: RESOLVED_HANDLE = {handle or empty}


Agent Mode (--agent flag)

If --agent appears in ARGUMENTS (e.g., /last30days plaud granola --agent):

  1. Skip the intro display block ("I'll research X across Reddit...")
  2. Skip any AskUserQuestion calls - use TARGET_TOOL = "unknown" if not specified
  3. Run the research script and WebSearch exactly as normal
  4. Skip the "WAIT FOR USER RESPONSE" pause
  5. Skip the follow-up invitation ("I'm now an expert on X...")
  6. Output the complete research report and stop - do not wait for further input

Agent mode saves raw research data to ~/Documents/Last30Days/ automatically via --save-dir (handled by the script, no extra tool calls).

Agent mode report format:

## Research Report: {TOPIC}
Generated: {date} | Sources: Reddit, X, Bluesky, YouTube, TikTok, HN, Polymarket, Web

### Key Findings
[3-5 bullet points, highest-signal insights with citations]

### What I learned
{The full "What I learned" synthesis from normal output}

### Stats
{The standard stats block}

If QUERY_TYPE = COMPARISON

When the user asks "X vs Y", run THREE research passes in parallel:

Pass 1 + 2 (parallel Bash calls):

# Run BOTH of these as parallel Bash tool calls in a single message:
python3 "${SKILL_ROOT}/scripts/last30days.py" {TOPIC_A} --emit=compact --no-native-web --save-dir=~/Documents/Last30Days
python3 "${SKILL_ROOT}/scripts/last30days.py" {TOPIC_B} --emit=compact --no-native-web --save-dir=~/Documents/Last30Days

Pass 3 (after passes 1+2 complete):

python3 "${SKILL_ROOT}/scripts/last30days.py" "{TOPIC_A} vs {T

...

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量19.1K
评分4.6 / 5.0
版本
更新日期2026年5月9日
对比案例1 组

用户评分

4.6(766)
5
9%
4
41%
3
41%
2
9%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧AI Agent CLI
🔧Manual

时间线

创建2026年4月7日
最后更新2026年5月9日