စလုံးကနေ မြန်မာ ငွေ လွှဲမယ် ဆိုရင် POSB/DBS ပဲ သုံးဖြစ်တယ်။ POSB/DBS ကနေ Aya ကို လွှဲတာ မြန်လည်း မြန်သလို စိတ်လည်းချရတယ်။ အခုတလော ငွေဈေးက ကျနတော့ website မှာ သွားသွား စစ်နေရတာ အဆင်မပြေဘူး။

ဘယ်လို အဆင်မပြေတာလဲ ဆိုတော့ website ကို history ကနေ ပြန်ရှာရတယ်။ ပြီးရင် Myanmar ကို ရွေးရတယ်။ နောက်ပြီး 1 ဆိုပြီး SGD ဘက်မှာ ပြန်ရိုက်ထည့်ရတယ်။ တစ်ခါတစ်လေ အဆင်ပြေပေမယ့် အမြဲတန်းကတော့ ပျင်းဖို့ ကောင်းတယ်။

ဒါနဲ့ node.js နဲ့ script ရေးလိုက်တယ်။ nightmare ကို သုံးပြီးတော့ data ယူတာကတော့ မစမ်းတော့ပါဘူး။

const Nightmare = require('nightmare')
const nightmare = Nightmare()

nightmare.goto('https://www.posb.com.sg/personal/deposits/pay-with-ease/international-transfers')
.select('#remitCalcCountry',"MMK")
.type("input[id='remitCalcSendingAmt']","1")
.evaluate(function() {
    return document.getElementById("remitCalcRecvAmt").value;
}).end().then((value) => {
    console.log(value);
}).catch((error) => {
    console.log(error)
});

အခုဆိုရင် node mmk ကို alias နဲ့ .zshrc ထဲမှာ ထည့်ထားလိုက်တယ်။

alias mmk='node /MY_SCRIPT_PATH/bg.js'

အခု ဆိုရင် code ရေးရင်း သိချင်ရင် terminal မှာ mmk လို့ရိုက်ထည့်လိုက်ရင် ပေါက်စျေးရပြီ။ website သွားကြည့်နေဖို့ မလိုတော့ဘူး။

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Saturngod

Subscribe now to keep reading and get access to the full archive.

Continue reading