Skip to content

Instantly share code, notes, and snippets.

@snoj
Last active July 24, 2016 03:24
Show Gist options
  • Save snoj/0715f0ee6ff2756cd0fdb06750e3af4d to your computer and use it in GitHub Desktop.
Save snoj/0715f0ee6ff2756cd0fdb06750e3af4d to your computer and use it in GitHub Desktop.
Rough sketch to save entire contents facebook group/page/community for non-admins
//open dev console of browser
//paste jquery.min.js contents
//https://github.com/jquery/jquery/releases
//load entire page
var scroller = setInterval(function() { window.scrollTo(0,document.body.scrollHeight); }, 1000);
//stop scroller
clearInterval(scroller);
var searchregex = /previous repl|more comment|see more|more reply|more replies|[0-9]+ repl/i;
var filterfunc = function(i, e) {
var txt = $(e).text();
return searchregex.test(txt) && !/hide/i.test(txt);
};
//count "more"
$('#pagelet_timeline_main_column').find('a').filter(filterfunc).length
//count "see more"
$('#pagelet_timeline_main_column').find('a').filter(filterfunc).length
//load "more"
$('#pagelet_timeline_main_column').find('a').filter(filterfunc).each(function(i, e) { $(e.click()); });
//walk away
var moreloader = setInterval(function() {
$('#pagelet_timeline_main_column').find('a').filter(function(i, e) { return searchregex.test($(e).text()); }).each(function(i, e) { $(e.click()); });
}, 60000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment