Add VRChatCurlOnline.sh
This commit is contained in:
parent
1b0c157648
commit
f470cea23d
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script that will curl the VRChat API to get all online and in game friends
|
||||||
|
|
||||||
|
CHECKONLINEFRIENDS="??? ??? ???" # The friends to check if online
|
||||||
|
|
||||||
|
VRCSECURITYCOOKIE="auth=authcookie_???; twoFactorAuth=???"
|
||||||
|
|
||||||
|
notify-send -t 3000 -a "VRChat Curl" "Checking..." "Now checking online users!"
|
||||||
|
|
||||||
|
APIREQUEST=$(curl -X 'GET' \
|
||||||
|
"https://vrchat.com/api/1/auth/user/friends?offline=false&n=50&offset=0" \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H "Cookie: $VRCSECURITYCOOKIE" \
|
||||||
|
-H "User-Agent: ***")
|
||||||
|
|
||||||
|
APICOUNT=$(($(echo $APIREQUEST | jq -r '. | length') - 1))
|
||||||
|
for friend in $CHECKONLINEFRIENDS; do
|
||||||
|
for i in $(seq 0 $APICOUNT); do
|
||||||
|
if [[ $(echo $APIREQUEST | jq -r .[$i].displayName) == $friend ]]; then
|
||||||
|
notify-send -t 0 -a "VRChat Curl" "$(echo $APIREQUEST | jq -r .[$i].displayName)" "User is in $(echo $APIREQUEST | jq -r .[$i].location) world!"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
Loading…
Reference in New Issue