Initial commit with translated description
This commit is contained in:
45
workflows/earnings-cron.yaml
Normal file
45
workflows/earnings-cron.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
# Earnings Alert Workflow for Cron (No Approval Gate)
|
||||
# Usage: lobster run --file workflows/earnings-cron.yaml --args-json '{"lang":"en"}'
|
||||
#
|
||||
# Schedule: 6:00 AM PT / 9:00 AM ET (30 min before market open)
|
||||
# Sends today's earnings calendar to WhatsApp/Telegram
|
||||
|
||||
name: finance.earnings.cron
|
||||
description: Send earnings alerts for today's reports
|
||||
|
||||
args:
|
||||
lang:
|
||||
default: en
|
||||
description: "Language: en or de"
|
||||
channel:
|
||||
default: "${FINANCE_NEWS_CHANNEL:-whatsapp}"
|
||||
description: "Delivery channel: whatsapp or telegram"
|
||||
target:
|
||||
default: "${FINANCE_NEWS_TARGET}"
|
||||
description: "Target: group name, JID, or chat ID"
|
||||
|
||||
steps:
|
||||
# Check earnings calendar for today and this week
|
||||
- id: check_earnings
|
||||
command: |
|
||||
SKILL_DIR="${SKILL_DIR:-$HOME/projects/skills/personal/finance-news}"
|
||||
python3 "$SKILL_DIR/scripts/earnings.py" check --lang "${lang}"
|
||||
description: Get today's earnings calendar
|
||||
|
||||
# Send earnings alert if there's content
|
||||
- id: send_earnings
|
||||
command: |
|
||||
MSG=$(cat)
|
||||
MSG=$(echo "$MSG" | tr -d '\r')
|
||||
# Only send if there are actual earnings today
|
||||
if echo "$MSG" | grep -q "EARNINGS TODAY\|EARNINGS HEUTE"; then
|
||||
openclaw message send \
|
||||
--channel "${channel}" \
|
||||
--target "${target}" \
|
||||
--message "$MSG"
|
||||
echo "Sent earnings alert to ${channel}"
|
||||
else
|
||||
echo "No earnings today - skipping message"
|
||||
fi
|
||||
stdin: $check_earnings.stdout
|
||||
description: Send earnings alert to channel
|
||||
Reference in New Issue
Block a user