Last active
May 25, 2020 20:52
-
-
Save dandyraka/deb45d9f79c8415a9d0e660d965a2681 to your computer and use it in GitHub Desktop.
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
var ambil_nama = document.getElementsByClassName("_6-_"); | |
var mutual = document.getElementsByClassName("_7ebi"); | |
var button_konfir = document.getElementsByClassName('_42ft _4jy0 _4jy3 _4jy1 selected _51sy'); | |
var i = 0; | |
var timer = setInterval(function() { | |
if (i < mutual.length) { | |
var x = i + 1; | |
//Get Nama | |
var hapus_html_nama = ambil_nama[i].innerHTML; | |
var nama = hapus_html_nama.replace(/(<([^>]+)>)/ig, ""); | |
//Get fbid | |
var getfbid = ambil_nama[i].querySelector('a[title="'+nama+'"]').getAttribute("data-hovercard"); | |
var paramfbid = /\?id\=(\d+)\&/i; | |
var fbid = getfbid.match(paramfbid)[1]; | |
console.log(fbid); | |
//Get jumlah mutual | |
var text = mutual[i].innerHTML; | |
var hapus_html = text.replace(/(<([^>]+)>)/ig, ""); | |
var numberPattern = /\d+/g; | |
var jum_mutual = hapus_html.match(numberPattern)[0]; | |
//Mutual minimal 10 | |
if (jum_mutual >= 10) { | |
var get_aria_button = button_konfir[x].getAttribute("aria-label"); | |
var ambilnama = /confirm\s(.*?)\'/i; | |
var namax = get_aria_button.match(ambilnama)[1]; | |
console.log(nama + ' => Memenuhi kriteria'); | |
if(nama == namax){ | |
//Klik confirm | |
//button_konfir[x].click(); | |
//console.log(nama + ' => Berhasil Confirm'); | |
} else { | |
console.log(nama + ' dan ' + namax + ' beda boss!!'); | |
} | |
} else { | |
console.log(nama + ' => Kurang memenuhi kriteria'); | |
} | |
} else { | |
clearInterval(timer); | |
} | |
i = i + 1; | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment