diff --git a/VRChatCurlOnline.sh b/VRChatCurlOnline.sh new file mode 100644 index 0000000..bf68f58 --- /dev/null +++ b/VRChatCurlOnline.sh @@ -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