Created
September 14, 2016 03:44
-
-
Save DevWellington/7e63db2b90404c662934bc8016ca7ee6 to your computer and use it in GitHub Desktop.
Instagram Bot - Scraper Following of user
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
var script = document.createElement('script'); | |
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// funcao para rodar o scroller | |
function scrollerDiv (height, interval, rodou) { | |
var i = 0; | |
var count = 1; | |
var timer = setInterval(function(){ | |
i++; | |
if (i = count) | |
clearInterval(timer); | |
$("._4gt3b").scrollTop(height); | |
console.log(interval, 'Tela rolada com height', height); | |
var length = $("._4gt3b ._4zhc5").length; | |
console.log(length, 'contatos já carregados!', rodou); | |
}, interval *1000); | |
} | |
// scroller | |
var time = 15; | |
var qtde_coleta = 40; | |
var interval = time; | |
var height = 0; | |
for (var i = qtde_coleta - 1; i >= 0; i--) { | |
height = ($("._4gt3b ._4zhc5").length+500)*61; | |
scrollerDiv(height, interval, i); | |
interval = interval + time; | |
}; | |
// rodar para coletar os seguidores | |
$("._4gt3b ._4zhc5").each(function(k, v){ | |
console.log(k, $(this).text()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment