Api Watch
Analyze video content using the eyeroll hosted API for insights.
Analyze a video URL or local file using the eyeroll hosted API.
Usage
/eyeroll:api-watch <url-or-path> [context]
What this does
- Reads
EYEROLL_API_KEYandEYEROLL_API_URLfrom the environment - POSTs the source and optional context to
/api/watch - Returns the structured markdown report
Steps
-
Check that
$EYEROLL_API_KEYis set. If not, tell the user to get a key at$EYEROLL_API_URL(orhttps://api.eyeroll.dev) and set it. -
Set
EYEROLL_API_URLtohttps://api.eyeroll.devif not already set. -
Run:
curl -s -X POST "$EYEROLL_API_URL/api/watch" \
-H "Authorization: Bearer $EYEROLL_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"source\": \"$ARGUMENTS\", \"context\": null}"
-
Parse the
reportfield from the JSON response and print it as markdown. -
If the response status is 429, tell the user their daily limit is reached and show the
reset_attime. -
If the response status is 401, tell the user their API key is invalid.