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
curl -s -b $COOKIE $BML_URL/profile > /dev/null
NAME=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .fullname')
PHONE=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .mobile_phone')
EMAIL=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .email')
DOB=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .birthdate' \
| cut -d 'T' -f 1)
IDCARD=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"] | .idcard')
USERINFO=$(curl -s -b $COOKIE $BML_URL/userinfo \
| jq -r '.["payload"] | .["user"]')
NAME=$(echo $USERINFO \
| jq -r .fullname)
PHONE=$(echo $USERINFO \
| jq -r .mobile_phone)
EMAIL=$(echo $USERINFO \
| jq -r .email)
DOB=$(echo $USERINFO \
| jq -r .birthdate \
| cut -d 'T' -f 1)
IDCARD=$(echo $USERINFO \
| jq -r .idcard)
#display a Welcome message with fullname
echo "${red}"