微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🌾

谷物情报自动抓取与情绪分析

Agresource · v1.0.0
效率 安全 C 级 作者 brianppetty 公开目录收录
下载 1.4k 安装 0 收藏 5.6k 浏览 13
原始页面

简介

自动化抓取 AgResource 谷物营销通讯,提取销售建议与价格情绪分析,为农产品交易决策提供数据支持。

原始描述

Scrapes and summarizes AgResource grain newsletters with daily sales advice, price-impact sentiment analysis, trend tracking, and Telegram alerts on updates.

中文使用说明 来自收录源

核心用法

AgResource Newsletter Scraper是一款面向农业大宗商品市场的自动化情报采集技能。该技能通过Playwright浏览器自动化技术,每日4次(早8:30、午1:30、晚7:00及周末下午3:00)定时登录AgResource付费仪表板,抓取玉米、大豆等谷物的每日营销通讯内容。系统支持morning/noon/evening/saturday/sunday五种通讯类型的分类采集,自动生成结构化摘要并存储于本地文件系统,同时通过Python情感分析模块识别市场情绪(看涨/看跌/中性),追踪产量预期、天气影响等多维度趋势指标,并在销售建议发生变化时向Telegram推送实时警报。

显著优点

该技能在农业市场情报处理方面具备显著的专业化优势。其一,多时段全覆盖采集能力确保用户不会错过任何重要市场动态,早晚及周末的差异化通讯类型均有对应处理逻辑;其二,价格导向的情感分析框架设计科学,明确区分"作物有利天气"与"价格看跌"的逆向关系,避免普通情感分析工具的误判;其三,本地Markdown+JSON的双轨存储架构便于长期历史回溯与趋势对比,15-20期的滚动窗口为决策提供充足的数据支撑;其四,Telegram即时推送机制实现了从信息采集到行动建议的闭环,特别适合需要快速响应市场变化的农产品交易者。

潜在缺点与局限性

该技能存在多重结构性缺陷。最严重的安全隐患在于代码中硬编码了AgResource网站的登录凭证(邮箱brianppetty@yahoo.com及密码),即使用户配置环境变量,内置默认值仍持续暴露账户风险。此外,技能强绑定单一付费信源AgResource,未提供多源交叉验证能力,若该服务变更接口或终止服务将导致技能完全失效。情感分析维度虽设计精巧,但仍依赖关键词匹配而非自然语言深度理解,对复杂市场情境(如"天气改善但出口强劲"的博弈场景)可能产生简化判断。最后,本地文件存储模式缺乏云端同步或多端访问能力,限制了协作场景的应用。

适合的目标群体

本技能最适合以下三类用户:一是从事玉米、大豆等谷物期货交易的个人投资者或小型交易团队,需要高频追踪专业机构的销售建议与情绪指标;二是农业产业链从业者(种植户、合作社、粮食贸易商)希望以低成本获取付费级市场情报;三是量化研究人员需要结构化历史数据进行回测模型训练。不适合对数据安全有严格合规要求的企业用户,也不推荐给缺乏基础技术能力、无法自行修复凭证配置问题的普通农户。

使用风险

安全风险(极高):硬编码凭证可导致账户被盗、付费内容泄露,甚至引发法律纠纷;合规风险:自动抓取付费内容可能违反AgResource服务条款,存在账号封禁风险;依赖风险:Playwright浏览器自动化对目标网站结构高度敏感,任何前端改版都将导致抓取失败;数据风险:本地存储缺乏加密机制,敏感市场分析数据面临未授权访问威胁;决策风险:情感分析输出仅供参考,不应作为唯一交易依据,市场剧烈波动期间自动化判断可能滞后于实际情况。

技能正文

AgResource Newsletter Scraper

Use this skill to scrape, summarize, and analyze AgResource grain marketing newsletters.

Implementation

  • Scraper: scraper.js (Playwright/Node.js)
  • Sentiment Analyzer: agresource_sentiment.py (Python)
  • Login: Automatic using AGRESOURCE_EMAIL and AGRESOURCE_PASSWORD env vars

Capabilities

  • Log in to AgResource dashboard (https://agresource.com/dashboard/#/reports/daily)
  • Scrape daily newsletter content using Playwright
  • Save screenshot for reference/debugging
  • Extract corn/soybean sales advice and recommendations
  • Generate concise summaries with key news and weather tidbits
  • Analyze sentiment (bullish/bearish) across newsletters
  • Compare to previous newsletters to detect trends
  • Store summaries in ~/clawd/memory/agresource/YYYY-MM-DD.md (morning)
  • Store summaries in ~/clawd/memory/agresource/YYYY-MM-DD-noon.md (noon)
  • Store summaries in ~/clawd/memory/agresource/YYYY-MM-DD-evening.md (evening)
  • Store summaries in ~/clawd/memory/agresource/YYYY-MM-DD-saturday.md (saturday)
  • Store summaries in ~/clawd/memory/agresource/YYYY-MM-DD-sunday.md (sunday)
  • Track sentiment history in ~/clawd/memory/agresource/sentiment_history.json
  • Send Telegram alerts on new sales advice

Commands

Manual Trigger

"Check AgResource newsletter"
"Summarize today's grain report"
"Show full newsletter" (detailed view)

To run scraper manually:

cd /home/brianppetty/clawd/skills/agresource

# Morning newsletter (default)
node scraper.js
node scraper.js --type=morning

# Noon/midday newsletter
node scraper.js --type=noon

# Evening newsletter
node scraper.js --type=evening

# Saturday newsletter
node scraper.js --type=saturday

# Sunday newsletter
node scraper.js --type=sunday

Cron Job Triggers

When a cron event fires, match the time/type to the correct --type parameter:

Cron Message Type to Use Time
"Check AgResource newsletter (morning)" --type=morning 8:30 AM ET (Mon-Fri)
"Check AgResource newsletter (afternoon)" --type=noon 1:30 PM ET (Mon-Fri)
"Check AgResource newsletter (evening - positioning)" --type=evening 7:00 PM ET (Mon-Sat)
"Check AgResource newsletter (weekend)" --type=saturday or --type=sunday ~3:00 PM ET (Sat/Sun)

For weekend jobs, determine which day it is and use:

  • Saturday: --type=saturday
  • Sunday: --type=sunday

Sentiment Queries

"What's the current market sentiment?"
"Show sentiment trends"
"What's the sentiment history?"

Sentiment Dimensions (PRICE-IMPACT FOCUSED)

CRITICAL: Sentiment analysis tracks PRICE IMPACT, not general "good/bad" news.

Key inverse relationships to remember:

  • ☀️ Favorable weather in SA/NA = More supply = BEARISH for prices
  • 🌽 Record yields = More supply = BEARISH for prices
  • 🏜️ Drought/crop stress = Less supply = BULLISH for prices
  • 🏭 Strong export demand = More demand = BULLISH for prices
  • 📦 South American competition = Less US exports = BEARISH for prices

Track these dimensions across newsletters:

  • market_mood: bullish | bearish | neutral
    • BULLISH = Prices expected to go UP
    • BEARISH = Prices expected to go DOWN
  • weather_impact: positive_for_crops | negative_for_crops | mixed | neutral
    • Tracks weather impact on PRODUCTION (inverted for price impact)
    • Positive weather for crops = BEARISH for prices (more supply)
    • Negative weather for crops = BULLISH for prices (less supply)
  • production_outlook: optimistic | cautious | uncertain
    • Optimistic = more supply = BEARISH for prices
    • Cautious = supply concerns = BULLISH for prices
  • trend_direction: improving | declining | stable
  • confidence: high | medium | low

Sales Advice Detection

Status phrases to detect:

  • "New sales advice detected" (buy/sell/recommend keywords)
  • "Catch up sales recommended" (catch up phrase)
  • "No sales recommended at this time" (hold/no action)
  • "Position status unchanged" (no change from previous)

Keywords for sales advice:

  • buy, sell, hold, recommend, recommendation, position, catch up, current positioning

Telegram Alert Format

Brief summary sent for every newsletter:

🌾 AgResource - 2026-01-08 8:30 AM

Summary: No sales recommended
Sentiment: Bullish (↗️ improving)

Full details in ~/clawd/memory/agresource/

Output Format

Daily Summary File (YYYY-MM-DD.md)

# AgResource Newsletter - 2026-01-08 8:30 AM

## Quick Summary
[2-3 sentence overview]

## Key Newsworthy Items
- [Grain production relevant news]
- [Weather tidbits]

## Sales Advice Status
- Corn: [New sales advice / No change / No sales recommended]
- Soybeans: [New sales advice / No change / No sales recommended]

## Current Positions (from end of newsletter)
- [Summary of current positioning]

## Sentiment & Trends
- **Market Mood:** Bullish / Bearish / Neutral
- **Previous Mood:** [from last newsletter]
- **Trend:** Improving / Declining / Stable
- **Weather Impact:** Positive / Negative / Mixed
- **Production Outlook:** Optimistic / Cautious / Uncertain

## Full Content
[Optional: full newsletter content for reference]

Sentiment History File (sentiment_history.json)

{
  "last_updated": "2026-01-08T08:30:00",
  "sentiment_history": [
    {
      "date": "2026-01-08",
      "time": "08:30 AM",
      "market_mood": "bullish",
      "weather_impact": "positive",
      "production_outlook": "optimistic",
      "trend_direction": "improving",
      "confidence": "high",
      "key_phrases": ["prices advancing", "favorable weather"],
      "sales_advice": "No sales recommended"
    }
  ]
}

Configuration

Credentials: Loaded from environment variables

  • AGRESOURCE_EMAIL
  • AGRESOURCE_PASSWORD

Dependencies:

  • Node.js (built-in on Clawdbot)
  • Playwright (installed locally: /home/brianppetty/clawd/skills/agresource/node_modules/playwright)

Schedule: 4x daily (cron jobs)

  • Morning: 8:30 AM ET
  • Afternoon: 1:30 PM ET
  • Evening: 7:00 PM ET
  • Weekend: ~3:00 PM ET

History window: Keep last 15-20 newsletters for sentiment tracking

Notes

  • Only send Telegram alerts when sales advice CHANGES
  • Always store summaries and sentiment data
  • Refine sentiment detection patterns over time
  • Evening newsletters include current positioning section
  • Login credentials should be handled securely

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

agriculturecommodity-tradingsentiment-analysisweb-scrapinggrain-marketingcornsoybeansnewsletterquantitative-analysistelegram-alerts

同类 Skill