Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created June 16, 2011 11:06
Show Gist options
  • Save kopiro/1029051 to your computer and use it in GitHub Desktop.
Save kopiro/1029051 to your computer and use it in GitHub Desktop.
Scroll down a Facebook profile (v2)
javascript:
var TIMER = 3000;
var foo_id = null;
function ssscript() {
if (foo_id) stopscript();
else startscript();
}
function stopscript() {
clearInterval(foo_id);
foo_id = null;
alert("Script Ended");
}
function startscript() {
foo_id = window.setInterval(function(){
var class_obj = document.getElementsByClassName('pam uiBoxLightblue uiMorePagerPrimary');
if (class_obj!=null){
var id = class_obj[0].getAttribute('onclick').split('\'')[1];
var jscc_obj = JSCC.get(id);
((jscc_obj) && jscc_obj.getHandler())();
window.scrollTo(0, document.height);
} else stopscript();
}, TIMER);
alert("Script started!");
}
window.onkeyup = function(k) {
if (k.keyCode==83) ssscript();
}
alert("Script sviluppato da Flavio De Stefano\nPer informazioni visita il sito http://kopiro.it\n\nPer avviare/mettere in pausa lo scorrimento premi il tasto S.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment