From f470cea23d2b2a60205b6c48f4f9774d8b803301 Mon Sep 17 00:00:00 2001 From: cspark Date: Wed, 28 Feb 2024 16:06:21 +0000 Subject: [PATCH] Add VRChatCurlOnline.sh --- VRChatCurlOnline.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 VRChatCurlOnline.sh 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