Salary From

This commit is contained in:
Shihaam Abdul Rahman 2021-05-12 22:52:44 +05:00
parent e5c033a1f0
commit 2c0cb7a06c

View File

@ -13,15 +13,14 @@ then
PROFILE=$(curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1) PROFILE=$(curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1)
curl -s -b $COOKIE $BML_URL/profile --data-raw profile=$PROFILE > /dev/null curl -s -b $COOKIE $BML_URL/profile --data-raw profile=$PROFILE > /dev/null
else else
echo Something went wrong echo Something went wrong.. Probably your account locked or wrong username password OR your IP Blocked by CF
exit exit
fi fi
CHECKDIFF1=$(echo $HISTORY | wc -c) CHECKDIFF1=$(echo $HISTORY | wc -c)
HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]') HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]')
CHECKDIFF2=$(echo $HISTORY | wc -c) CHECKDIFF2=$(echo $HISTORY | wc -c)
SLEEP=$(cat delay) DELAY=$(cat delay)
sleep $SLEEP
if [ "$CHECKDIFF1" != "$CHECKDIFF2" ] if [ "$CHECKDIFF1" != "$CHECKDIFF2" ]
then then
@ -37,17 +36,19 @@ then
ENTITY=$(echo $HISTORY | jq -r .narrative3 | head -n1) ENTITY=$(echo $HISTORY | jq -r .narrative3 | head -n1)
elif [ "$DESCRIPTION" = "Salary" ] elif [ "$DESCRIPTION" = "Salary" ]
then then
FROMTO=From
ENTITY=$(echo $HISTORY | jq -r .narrative2 | head -n1) ENTITY=$(echo $HISTORY | jq -r .narrative2 | head -n1)
fi fi
echo $DESCRIPTION echo $DESCRIPTION
echo $FROMTO: $ENTITY echo $FROMTO: $ENTITY
echo $CURRENCY: $AMOUNT echo $CURRENCY: $AMOUNT
DESCRIPTION=`echo $DESCRIPTION | sed "s/ /%20/g"` DESCRIPTION=`echo $DESCRIPTION | sed "s/ /%20/g"` #Fix spaces
ENTITY=`echo $ENTITY | sed "s/ /%20/g"` ENTITY=`echo $ENTITY | sed "s/ /%20/g"` #Fix spaces
TGTEXT=$(echo $DESCRIPTION%0A$FROMTO:%20$ENTITY%0A$CURRENCY:%20$AMOUNT) TGTEXT=$(echo $DESCRIPTION%0A$FROMTO:%20$ENTITY%0A$CURRENCY:%20$AMOUNT)
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=$TGTEXT > /dev/null curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=$TGTEXT > /dev/null
echo "Next Check in $SLEEP seconds" echo "Next check in $DELAY seconds"
else else
echo "nothing new..checking again in $SLEEP seconds" echo "nothing new..checking again in $DELAY seconds"
fi fi
sleep $DELAY
done done