返回顶部
l

lastxdays最近N天事件

Research and summarize what happened in the last N days (or a date range) about a topic, optionally using Reddit API and X ingestion via x-cli/API/archive with graceful fallback to web.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
726
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

lastxdays

lastXdays Skill

Summarize what happened in the last N days (or a specific YYYY-MM-DD → YYYY-MM-DD range) about a user-provided topic.

Default behavior is web-first (web_search + selective web_fetch). If optional credentials/data are available, you may ingest Reddit via API and X via x-cli (preferred), API, or local archive, falling back to web search if unavailable.

Trigger Patterns

Activate when the user message contains any of:

  • - lastXdays / INLINECODE3
  • INLINECODE4
  • A question like: "what happened in the last N days" (optionally followed by a topic)

Default Model

Default to sonnet (anthropic/claude-sonnet-4-6) when spawning as a subagent.

Use flash (openrouter/google/gemini-2.0-flash-001) only for simple single-source lookups (one topic, one platform, straightforward synthesis with no file reading required). Flash is unreliable for multi-step agentic work requiring tool chaining (search → fetch → read files → synthesize → report). When in doubt, use sonnet.

Input Parsing

Parse from the user message:

1) Date range (preferred if explicit)

If the user supplies a range like:
  • - INLINECODE9
  • INLINECODE10

Then:

  • - INLINECODE11
  • INLINECODE12
  • Ignore N if both are present.

2) Days (N)

Otherwise, infer N:
  • - Look for an integer N associated with the request, e.g.:
- lastxdays 7 <topic> - 7 lastxdays <topic> - what happened in the last 14 days (about|re:) <topic>
  • - Default: INLINECODE19
  • Clamp: INLINECODE20

3) Sources (optional)

Supported: web|reddit|x|all.

Accept any of:

  • - for web / INLINECODE23
  • INLINECODE24 / INLINECODE25
  • INLINECODE26 / INLINECODE27
  • INLINECODE28 / INLINECODE29

If unspecified: sources = all.

4) Topic

  • - The remaining text (after removing trigger words, N/range, and source phrases) is the topic.
  • If topic is empty/unclear, ask exactly one clarifying question and stop.

Date Range (freshness)

Use an inclusive range in local time:

  • - freshness = start + "to" + end (e.g., 2026-01-10to2026-02-08)

Helper for “last N days”:

  • - INLINECODE33

Optional non-web ingestion (Reddit/X)

Use this helper to ingest Reddit/X when possible:

  • - INLINECODE34

The script attempts:

  • - Reddit: official API via OAuth (if credentials exist), else returns INLINECODE35
  • X: x-cli search first (if installed/configured), then Twitter API v2 recent search (if bearer token + range <= ~7 days), then local archive at ~/clawd/data/x-archive/, else returns INLINECODE38

Required environment variables (if you want API mode):

  • - Reddit:
- REDDIT_CLIENT_ID - REDDIT_CLIENT_SECRET - either REDDIT_REFRESH_TOKEN (recommended) or REDDIT_USERNAME + REDDIT_PASSWORD - optional: INLINECODE44
  • - X API (optional; only works for recent ranges on most tiers):
- X_BEARER_TOKEN (also accepts TWITTER_BEARER_TOKEN)
  • - x-cli (optional, preferred for agent use):
- Install: uv tool install x-cli (or from source) - Configure credentials in ~/.config/x-cli/.env (supports shared setup with x-mcp) - If present, lastxdays_ingest.js uses it before raw API/archive for X search

Credentials loader:

  • - Reads ~/.config/last30days/.env if present (does not hard-fail if missing)
  • Environment variables override .env values (file only fills blanks)

Research Procedure

1) Compute start/end/freshness.

2) For each requested source:

Web

  • - Query: INLINECODE53
  • Run web_search with freshness (count 5–8)
  • Optionally web_fetch 2–6 best links

Reddit

Preferred:
  • - Run INLINECODE57
  • If it returns fallback:false, treat returned items[] as “Notable links” (each has a Reddit permalink URL).
  • If items[] is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.

Fallback (if fallback:true):

  • - Run web_search with query site:reddit.com/r <topic> and the same INLINECODE64

X

Preferred:
  • - Run INLINECODE65
  • If mode=x-cli, mode=api, or mode=archive, treat returned items[] as “Notable links” (each has a URL)
- If mode=x-cli, note that X results came from local x-cli execution - If mode=archive, note that links come from the local X archive
  • - If items[] is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.

Fallback (if fallback:true):

  • - Run web_search with query site:x.com <topic> and the same INLINECODE77
  • Expect web_fetch to fail often on x.com; rely on snippets when needed

3) Select and deduplicate links/items:

  • - Prefer authoritative sources for Web
  • Prefer high-engagement or highly-informative posts for Reddit/X
  • Keep total links/items shown to ~10–20 max

Output Format (Markdown)

Title:

  • - INLINECODE80

- If an explicit range was used, you may replace <N> days with YYYY-MM-DD → YYYY-MM-DD.

Then include sections in this order:

1) Date range used

  • - YYYY-MM-DD → YYYY-MM-DD (and optionally the freshness string)

2) Top themes

  • - 3–7 bullets summarizing the dominant storylines/trends

3) Notable links
Group by platform in this order, including only platforms actually searched:

  • - Web
  • Reddit
  • X

For each link/item:

  • - Markdown link
  • One line: why it matters
  • If snippet-only (fetch failed/unavailable), say so

4) What to follow up on

  • - 3 copy/pasteable next searches

Smoke tests (local)

Date range helper:

  • - INLINECODE84

Reddit ingest (requires creds or it will return fallback=true):

  • - INLINECODE85

X ingest (x-cli if installed; else API if bearer token + <=7 days; else local archive; else fallback=true):

  • - INLINECODE86

Optional x-cli direct smoke test:

  • - INLINECODE87

Examples

  • - INLINECODE88
  • INLINECODE89
  • INLINECODE90
  • INLINECODE91
  • INLINECODE92
  • INLINECODE93

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 lastxdays-1776420063 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 lastxdays-1776420063 技能

通过命令行安装

skillhub install lastxdays-1776420063

下载

⬇ 下载 lastxdays v1.0.2(免费)

文件大小: 3.48 KB | 发布时间: 2026-4-17 20:17

v1.0.2 最新 2026-4-17 20:17
Fix model guidance: sonnet default, flash only for simple single-source runs

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部