reduced repeated network requests - thanks phoenixatom

This commit is contained in:
Shihaam Abdul Rahman 2021-05-04 19:17:54 +05:00
parent 8b1538d9d1
commit b6a6df2bf2

View File

@ -1,17 +1,20 @@
#Requesting for User profile after login and regex to grap the Full name #Requesting for User profile after login and regex to grap the Full name
curl -s -b $COOKIE $BML_URL/profile > /dev/null curl -s -b $COOKIE $BML_URL/profile > /dev/null
NAME=$(curl -s -b $COOKIE $BML_URL/userinfo \ USERINFO=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .fullname') | jq -r '.["payload"] | .["user"]')
PHONE=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .mobile_phone') NAME=$(echo $USERINFO \
EMAIL=$(curl -s -b $COOKIE $BML_URL/userinfo \ | jq -r .fullname)
| jq -r '.["payload"] | .["user"] | .email') PHONE=$(echo $USERINFO \
DOB=$(curl -s -b $COOKIE $BML_URL/userinfo \ | jq -r .mobile_phone)
| jq -r '.["payload"] | .["user"] | .birthdate' \ EMAIL=$(echo $USERINFO \
| cut -d 'T' -f 1) | jq -r .email)
IDCARD=$(curl -s -b $COOKIE $BML_URL/userinfo \ DOB=$(echo $USERINFO \
| jq -r '.["payload"] | .["user"] | .idcard') | jq -r .birthdate \
| cut -d 'T' -f 1)
IDCARD=$(echo $USERINFO \
| jq -r .idcard)
#display a Welcome message with fullname #display a Welcome message with fullname
echo "${red}" echo "${red}"