basic code

This commit is contained in:
Shihaam Abdul Rahman 2022-11-16 22:46:27 +05:00
parent 4eec801b0d
commit 5f5b6d7393
Signed by: shihaam
GPG Key ID: 5641D129E0B55604
2 changed files with 46 additions and 0 deletions

28
env.example Normal file
View File

@ -0,0 +1,28 @@
# EDIT THESE TO YOUR CONFIG
# BML Config
# Your BML Username
BML_USERNAME=''
# Your BML Password
BML_PASSWORD=''
# Your BML Account ID,NOT to be confused with account number,
# read the README.md on how to obtain this.
BML_ACCOUNTID=''
# Delays
# Delay in seconds for script to stop if logged in from another device
APP_OPEN_DELAY='600'
# Delay in seconds for script to check for new transactions
NORMAL_DELAY='40'
# Telegram Config
# Your Telegram Bot API Token, Contact @BotFather on Telegram to obtain token
TG_BOT_TOKEN=''
# Your Telegram chat ID, This could be your user, group, supergroup or channel ID
# add "-100" first if supergroup or channel
TG_CHATID=''
# DO NOT EDIT THESE UNLESS YOU KNOW WHAT YOURE DOING
COOKIE=.cache/cookie
curl='curl'
TG_BOTAPI='https://api.telegram.org/bot'
BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api'

18
get-balance.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
#Import variable
source .env
#Login
$curl -s -c $COOKIE $BML_URL/login \
--data-raw username=$BML_USERNAME \
--data-raw password=${BML_PASSWORD}
# Get profiles and select personal profile
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 -c $COOKIE $BML_URL/api/dashboard