Skip to content

Instantly share code, notes, and snippets.

@tobiasmuehl
Last active March 24, 2024 06:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobiasmuehl/8fcaa3f9a5f329d8fc06b141d082309b to your computer and use it in GitHub Desktop.
Save tobiasmuehl/8fcaa3f9a5f329d8fc06b141d082309b to your computer and use it in GitHub Desktop.
Copy this in your developers console to expand all posts and comments on a Facebook page
// 1. Scroll to bottom of the FB page to load all posts
// 2. Copy jQuery into the dev console, so that $ becomes available
// 3. Execute this script, which will expand all posts, comments and comments replies
// 4. Rerun to make sure every post/comment is picked up (after console.log is not logging more events)
// reset array
window.a = [];
// fill with links
$('.UFIPagerLink, .UFIReplySocialSentenceLinkText').add('div.userContent .see_more_link').add('div.userContent .see_more_link').each(function() { window.a.push(this) });
$('.UFICommentActorAndBody a').filter(function(i, el) { return $(el).text() === 'See more' }).each(function() { window.a.push(this) });
// click one by one (synchronously to prevent RAM flooding/browser crashes)
setTimeout(function() {
(function myLoop (i) {
setTimeout(function () {
window.a[i].click();
console.log(i);
if (--i) myLoop(i);
}, 500)
})(window.a.length - 1);
}, 5000);
Copy link

ghost commented Mar 25, 2018

Hello!
Auto expand all comments and replies on Facebook For this plugin...
https://developers.facebook.com/docs/plugins/comments
No way to limit but please help, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment