Skip to content

Instantly share code, notes, and snippets.

@kLabz
Last active March 22, 2022 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kLabz/2ee95ad132bf70a2b6830921aaa9f6a4 to your computer and use it in GitHub Desktop.
Save kLabz/2ee95ad132bf70a2b6830921aaa9f6a4 to your computer and use it in GitHub Desktop.
Astro slide delivery monitoring
{
"user_id": 123456,
"contrib_id": 123456,
"cookie": "..."
}
#!/bin/sh
USER_ID=$(cat ~/Doc/astro-contrib.json | jq -r '.user_id')
CONTRIB_ID=$(cat ~/Doc/astro-contrib.json | jq -r '.contrib_id')
COOKIE=$(cat ~/Doc/astro-contrib.json | jq -r '.cookie')
STATUS="Info"
TEXT=$(curl -s "https://www.indiegogo.com/private_api/accounts/$USER_ID/contributions/$CONTRIB_ID" \
-H "authority: www.indiegogo.com" \
-H "pragma: no-cache" \
-H "cache-control: no-cache" \
-H 'sec-ch-ua: "Chromium";v="98", " Not A;Brand";v="99"' \
-H "x-locale: en" \
-H "dnt: 1" \
-H "sec-ch-ua-mobile: ?0" \
-H "user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.121 Safari/537.36" \
-H "accept: application/json, text/plain, */*" \
-H "x-has-account: true" \
-H 'sec-ch-ua-platform: "Linux"' \
-H "sec-fetch-site: same-origin" \
-H "sec-fetch-mode: cors" \
-H "sec-fetch-dest: empty" \
-H "referer: https://www.indiegogo.com/individuals/$USER_ID/contributions/$CONTRIB_ID" \
-H "accept-language: en-US,en;q=0.9" \
-H "cookie: $COOKIE" \
--compressed \
| jq -r '.response.display_status.overall')
# Mock order locked
# TEXT="order_locked"
case $TEXT in
"order_placed")
STATUS="Idle"
TEXT="Astro delivery: Pending";;
"order_locked")
STATUS="Critical"
TEXT="Astro delivery: Locked!!";;
"")
STATUS="Info"
TEXT="Error fetching astro delivery status";;
esac
echo "{\"state\": \"$STATUS\", \"text\": \"$TEXT\"}"
[[block]]
block = "custom"
command = "astrodelivery.sh"
on_click = "<command>"
interval = 1800
json = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment