Last active
November 8, 2019 12:29
-
-
Save woodwardtw/951fe0d14081f822ea9b to your computer and use it in GitHub Desktop.
This bookmarklet opens up FB comments via http://www.alecjacobson.com/weblog/?p=4074 and http://mikakesensei.com/perso/javascript/fb_expander.js - Just make a new bookmark and cut/paste this into the URL field.
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
javascript: var cur_arr = []; | |
function what_to_click() { | |
if (cur_arr.length) { | |
return cur_arr.pop(); | |
} else { | |
cur_arr = [].slice.call(document.getElementsByClassName("UFIPagerLink")); | |
if (cur_arr.length) { | |
return cur_arr.pop(); | |
} else { | |
cur_arr = [].slice.call(document.getElementsByClassName("UFIReplySocialSentenceLinkText UFIReplySocialSentenceVerified")).filter(function(k) { | |
return !~k.textContent.indexOf("Masquer"); | |
}); | |
} | |
if (cur_arr.length) { | |
return cur_arr.pop(); | |
} else { | |
cur_arr = [].slice.call(document.getElementsByClassName("fss")).filter(function(k) { | |
return !~k.textContent.indexOf("Masquer"); | |
}); | |
} | |
if (cur_arr.length) { | |
return cur_arr.pop(); | |
} else { | |
cur_arr = [].slice.call(document.getElementsByClassName("see_more_link")).filter(function(k) { | |
return !~k.textContent.indexOf("Masquer"); | |
}); | |
} | |
if (cur_arr.length) { | |
return cur_arr.pop(); | |
} | |
} | |
} | |
function auto_callback() { | |
var i = what_to_click(); | |
if (!i) { | |
console.log("-------- done --------"); | |
alert("Done!"); | |
return; | |
} else { | |
console.log("click '" + i.textContent + "'"); | |
i.click(); | |
window.setTimeout(function() { | |
auto_callback(); | |
}, 10); | |
} | |
} | |
auto_callback(); |
woodwardtw, thank you!
Your code works pretty well!
Can you please include expanding this type of things "*** replied · *** Replies"?
Thank you in advance!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi woodwardtw, the code does work, but it has some issues:
The second one is crucial, as I cannot scroll and load older posts. Every time facebook tries to load an old post, the code takes me back to the header, so it is really impossible to read old posts.
Is it possible to fix these issues, it is a great function...