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 characters
| function solveCaptcha(siteKey, pageUrl){ | |
| const apiKey = "YOUR_API_KEY"; | |
| //make a GET request to 2captcha | |
| fetch(`https://2captcha.com/in.php?key=${apiKey} | |
| &method=userrecaptcha&googlekey=${siteKey}&pageurl=${pageUrl}&json=1`) | |
| .then(response => response.json()) | |
| .then(data => { | |
| //check if there's an error | |
| if(!data.status){ | |
| //print out error |
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 characters
| function solveCaptcha(siteKey, pageUrl){ | |
| //make printing text easier | |
| let log = (text) => {console.log(text)}; | |
| let logErr = (text) => {console.error(text)}; | |
| //your api key | |
| const apiKey = "YOUR_API_KEY"; | |
| //make a GET request to 2captcha | |
| fetch(`https://2captcha.com/in.php?key=${apiKey} | |
| &method=userrecaptcha&googlekey=${siteKey}&pageurl=${pageUrl}&json=1`) | |
| .then(response => response.json()) |
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 characters
| for (let key in profile) { | |
| console.log(key +' = '+ profile[key]); | |
| } |
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 characters
| const profile = { | |
| name : "Simon", | |
| email: "me@you.com", | |
| gender : "male" | |
| } | |
| //loop through keys | |
| Object.keys(profile).forEach( (key) => { | |
| //access object value using key | |
| console.log( key+' = '+profile[key] ); | |
| }); |
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 characters
| const profile = { | |
| name : "Simon", | |
| email: "me@you.com", | |
| gender : "male" | |
| } | |
| let i = 0; | |
| //get the length of the object | |
| while( i < Object.keys(profile).length ){ | |
| //since we hold the current index, retrieve the key and value assigned to it | |
| console.log( Object.keys(profile)[i]+' = '+Object.values(profile)[i] ); |
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 characters
| //our table's data | |
| const tableData = { | |
| 1 : ["Simon ugorji", "simon@gmail.com", "01234", "Germany"], | |
| 2 : ["Tony ugorji", "tony@gmail.com", "013234", "Turkey"], | |
| 3 : ["Victor ugorji", "victor@gmail.com", "014234", "Germany"], | |
| 4 : ["Felix ugorji", "felix@gmail.com", "011234", "Canada"], | |
| 5 : ["Jordan ugorji", "jordan@gmail.com", "016234", "Costa Rica"], | |
| 6 : ["Henry ugorji", "henry@gmail.com", "0166234", "Belgium"], | |
| 7 : ["Frank Sams", "sams@gmail.com", "01234", "Nigeria"], | |
| 8 : ["John Doe", "jonny@gmail.com", "0123466", "Australia"], |
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 characters
| //attach event listener | |
| document.querySelector('#inp_search').addEventListener('input', function(){ | |
| //store the search query | |
| let value = this.value.trim(); | |
| //check if value is not empty | |
| if(value){ | |
| //store matching record IDs | |
| let matchingIDs = []; | |
| //loop index | |
| let ind = 1; |
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 characters
| //function to build table | |
| function buildTable(matchingIDs){ | |
| //reset table data | |
| tableDataElem.innerHTML = ""; | |
| //check if parameter is provided | |
| if(typeof matchingIDs === "undefined"){ | |
| //our loop index | |
| let ind = 0; | |
| //our table index | |
| let tableInd = 1; |
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 characters
| //attach event listener | |
| document.querySelector('#inp_search').addEventListener('input', function(){ | |
| //store the search query | |
| let value = this.value.trim(); | |
| //check if value is not empty | |
| if(value){ | |
| }else{ | |
| } |
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 characters
| //our table's data | |
| const tableData = { | |
| 1 : ["Simon ugorji", "simon@gmail.com", "01234", "Germany"], | |
| 2 : ["Tony ugorji", "tony@gmail.com", "013234", "Turkey"], | |
| 3 : ["Victor ugorji", "victor@gmail.com", "014234", "Paris"], | |
| 4 : ["Felix ugorji", "felix@gmail.com", "011234", "Canada"], | |
| 5 : ["Jordan ugorji", "jordan@gmail.com", "016234", "Costa Rica"], | |
| 6 : ["Henry ugorji", "henry@gmail.com", "0166234", "Belgium"], | |
| 7 : ["Frank Sams", "simon@gmail.com", "01234", "Nigeria"], | |
| 8 : ["John Doe", "jonny@gmail.com", "0123466", "Australia"], |