gdelt-mentions-fetch
Fetch GDELT 2.0 Global Mentions export snapshots from lastupdate/masterfilelist with retry, throttling, transport validation, and structure validation. Use when tasks need latest or time-range mentions files (*.mentions.CSV.zip) for deterministic ingestion and machine-readable manifests.
What this skill does
# GDELT Mentions Fetch ## Core Goal - Fetch GDELT 2.0 `Global Mentions` table exports (`*.mentions.CSV.zip`) from official public endpoints. - Resolve latest available snapshot via `lastupdate.txt`. - Resolve historical snapshots in a UTC range via `masterfilelist.txt`. - Persist downloaded files and return machine-readable JSON manifest. - Keep runtime observable with structured logs and optional log file. ## Required Environment - Configure runtime by environment variables (see `references/env.md`). - Start from `assets/config.example.env`. - Load env values before running commands: ```bash set -a source assets/config.example.env set +a ``` ## Workflow 1. Validate effective configuration. ```bash python3 scripts/gdelt_mentions_fetch.py check-config --pretty ``` 2. Inspect the latest available mentions snapshot. ```bash python3 scripts/gdelt_mentions_fetch.py resolve-latest --pretty ``` 3. Dry-run a historical range selection before downloading. ```bash python3 scripts/gdelt_mentions_fetch.py fetch \ --mode range \ --start-datetime 20260301000000 \ --end-datetime 20260301120000 \ --max-files 3 \ --dry-run \ --pretty ``` 4. Fetch files with transport and structure validation. ```bash python3 scripts/gdelt_mentions_fetch.py fetch \ --mode latest \ --max-files 1 \ --output-dir ./data/gdelt-mentions \ --preview-lines 2 \ --validate-structure \ --expected-columns 16 \ --quarantine-dir ./data/gdelt-mentions-quarantine \ --log-level INFO \ --log-file ./logs/gdelt-mentions-fetch.log \ --pretty ``` ## Built-in Robustness - Apply retry with exponential backoff on transient HTTP/network failures. - Respect `Retry-After` when present on retriable responses. - Throttle request frequency with a minimum interval between requests. - Enforce `--max-files` safety cap (`GDELT_MAX_FILES_PER_RUN`) to prevent accidental bulk pulls. - Validate datetime format and range boundaries before remote calls. - Validate transport and structure after download: - ZIP CRC/integrity check - UTF-8 strict decoding check - Tab column-count check (default 16) - Optional bad-line issue quarantine (`--quarantine-dir`) - Emit JSON results while writing operational logs to stderr and optional log file. ## Scope Decision - Keep one concrete file-table fetch implementation: `Global Mentions` (`*.mentions.CSV.zip`). - Keep atomic operations only; do not add internal scheduler/polling loops. ## References - `references/gdelt-data-sources.md` - `references/gdelt-limitations.md` - `references/gdelt-schema.md` - `references/env.md` - `references/openclaw-chaining-templates.md` ## Script - `scripts/gdelt_mentions_fetch.py` ## OpenClaw Invocation Compatibility - Keep skill trigger metadata in `name`, `description`, and `agents/openai.yaml`. - Invoke in prompts with `$gdelt-mentions-fetch`. - Keep the skill atomic: only resolve/fetch on demand. - Use script parameters for fetch conditions (`--mode range --start-datetime --end-datetime`). - If you need polling, let OpenClaw orchestrate repeated invocations externally, not inside this skill. ## OpenClaw Prompt Templates Use these templates directly in OpenClaw and only replace bracketed placeholders. 1. Recon (latest availability) ```text Use $gdelt-mentions-fetch. Run: python3 scripts/gdelt_mentions_fetch.py resolve-latest --pretty Return only the JSON result. ``` 2. Fetch (historical window, dry-run first) ```text Use $gdelt-mentions-fetch. Run: python3 scripts/gdelt_mentions_fetch.py fetch \ --mode range \ --start-datetime [YYYYMMDDHHMMSS] \ --end-datetime [YYYYMMDDHHMMSS] \ --max-files [N] \ --dry-run \ --pretty Then run without --dry-run using: --output-dir [OUTPUT_DIR] --validate-structure --expected-columns 16 --quarantine-dir [QUARANTINE_DIR] Return only the JSON result. ``` 3. Validate (download quality gate) ```text Use $gdelt-mentions-fetch. Run: python3 scripts/gdelt_mentions_fetch.py fetch \ --mode latest \ --max-files 1 \ --output-dir [OUTPUT_DIR] \ --validate-structure \ --expected-columns 16 \ --quarantine-dir [QUARANTINE_DIR] \ --pretty Check validation.issue_count, decode_error_count, column_mismatch_count. Return JSON plus one-line pass/fail verdict. ```
Related in Data & Analytics
clawarr-suite
IncludedComprehensive management for self-hosted media stacks (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Overseerr, Plex, Tautulli, SABnzbd, Recyclarr, Unpackerr, Notifiarr, Maintainerr, Kometa, FlareSolverr). Deep library exploration, analytics, dashboard generation, content management, request handling, subtitle management, indexer control, download monitoring, quality profile sync, library cleanup automation, notification routing, collection/overlay management, and media tracker integration (Trakt, Letterboxd, Simkl).
querying-soql
IncludedSOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
habit-flow
IncludedAI-powered atomic habit tracker with natural language logging, streak tracking, smart reminders, and coaching. Use for creating habits, logging completions naturally ("I meditated today"), viewing progress, and getting personalized coaching.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
visualizing-data
IncludedBuilds dashboards, reports, and data-driven interfaces requiring charts, graphs, or visual analytics. Provides systematic framework for selecting appropriate visualizations based on data characteristics and analytical purpose. Includes 24+ visualization types organized by purpose (trends, comparisons, distributions, relationships, flows, hierarchies, geospatial), accessibility patterns (WCAG 2.1 AA compliance), colorblind-safe palettes, and performance optimization strategies. Use when creating visualizations, choosing chart types, displaying data graphically, or designing data interfaces.