From 2c0cb7a06cd8a116c9e44abd7aa3ca21ce192934 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Wed, 12 May 2021 22:52:44 +0500 Subject: [PATCH] Salary From --- bml-tg-notify/bml-tg-notify.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bml-tg-notify/bml-tg-notify.sh b/bml-tg-notify/bml-tg-notify.sh index 6d164b7..ade6145 100755 --- a/bml-tg-notify/bml-tg-notify.sh +++ b/bml-tg-notify/bml-tg-notify.sh @@ -13,15 +13,14 @@ then 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 else - echo Something went wrong + echo Something went wrong.. Probably your account locked or wrong username password OR your IP Blocked by CF exit fi CHECKDIFF1=$(echo $HISTORY | wc -c) HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]') CHECKDIFF2=$(echo $HISTORY | wc -c) -SLEEP=$(cat delay) -sleep $SLEEP +DELAY=$(cat delay) if [ "$CHECKDIFF1" != "$CHECKDIFF2" ] then @@ -37,17 +36,19 @@ then ENTITY=$(echo $HISTORY | jq -r .narrative3 | head -n1) elif [ "$DESCRIPTION" = "Salary" ] then + FROMTO=From ENTITY=$(echo $HISTORY | jq -r .narrative2 | head -n1) fi echo $DESCRIPTION echo $FROMTO: $ENTITY echo $CURRENCY: $AMOUNT - DESCRIPTION=`echo $DESCRIPTION | sed "s/ /%20/g"` - ENTITY=`echo $ENTITY | sed "s/ /%20/g"` + DESCRIPTION=`echo $DESCRIPTION | sed "s/ /%20/g"` #Fix spaces + ENTITY=`echo $ENTITY | sed "s/ /%20/g"` #Fix spaces 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 - echo "Next Check in $SLEEP seconds" + echo "Next check in $DELAY seconds" else - echo "nothing new..checking again in $SLEEP seconds" + echo "nothing new..checking again in $DELAY seconds" fi +sleep $DELAY done