INNER CODE UNIT · Shell

NOW_EPOCH

okx/agent-skills · skills/earn-hunter/scripts/scan.sh:784

NOW_EPOCH=$(date +%s 2>/dev/null)
CUTOFF=$(( NOW_EPOCH - TTL_DAYS * 86400 ))
tmp=$(jq --argjson cutoff "$CUTOFF" '
  def keep(e):
    ( e.notifiedAt // "" ) as $ts
    | if $ts=="" then true
      else ( ($ts | sub("\\+.*$";"Z") | sub("Z$";"Z") | try (fromdateiso8601) catch null) ) as $ep
           | if $ep==null then true else ($ep >= $cutoff) end
      end;
  .flash = (.flash | with_entries(select(keep(.value))))
  | .fixed = (.fixed | with_entries(select(keep(.value))))
  | .flexible = (.flexible | with_entries(select(keep(.value))))
' "$STATE_FILE" 2>/dev/null)
[[ -n "$tmp" ]] && printf '%s\n' "$tmp" > "$STATE_FILE"

# ---- Step 6d: success ----
mark_success

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…