Last active
July 24, 2016 03:24
-
-
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
This file contains hidden or 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
//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