Last active
August 31, 2018 12:53
-
-
Save KristerV/873bf14e9dc73aeed0d7db11b257fb79 to your computer and use it in GitHub Desktop.
Revisions
-
KristerV revised this gist
Jan 1, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,7 @@ procedure = function() { console.log("Finished procedure") setTimeout(function(){ startOver() }, 1000 * 60 * 1) } }, 10000) } -
KristerV renamed this gist
Jan 1, 2018 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ /* This will expand all of the posts and comments that is in the view. It will take a lot of time! To use just paste this in your console (F12). */ var previousScrollheight = 0 @@ -15,6 +16,12 @@ scrollDown = function() { expandComments = function() { var foundLinks = 0 document.querySelectorAll(':not(.text_exposed) > .text_exposed_hide > .text_exposed_link > .see_more_link').forEach(function(item) { item.click() foundLinks++ }) document.querySelectorAll('[href="#"]').forEach(function(item){ var whitelist = ["See more", "More option", "more comment", "replie"] var blacklist = ["Hide", " hidden", "u_0_19"] -
KristerV revised this gist
Jan 1, 2018 . No changes.There are no files selected for viewing
-
KristerV revised this gist
Jan 1, 2018 . 1 changed file with 19 additions and 25 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,29 +14,23 @@ scrollDown = function() { } expandComments = function() { var foundLinks = 0 document.querySelectorAll('[href="#"]').forEach(function(item){ var whitelist = ["See more", "More option", "more comment", "replie"] var blacklist = ["Hide", " hidden", "u_0_19"] var blacklistRegexp = new RegExp(blacklist.join("|"), "i") var whitelistResult = new RegExp(whitelist.join("|"), "i").test(item.innerHTML) var blacklistResultHTML = !(blacklistRegexp.test(item.innerHTML)) var blacklistResultClass = !(blacklistRegexp.test(item.className)) var blacklistResultId = !(blacklistRegexp.test(item.id)) if (whitelistResult && blacklistResultHTML && blacklistResultClass && blacklistResultId) { foundLinks++ item.click() } }) return foundLinks } procedure = function() { @@ -48,7 +42,9 @@ procedure = function() { procedure() } else { console.log("Finished procedure") setTimeout(function(){ startOver() }, 1000 * 60 * 5) } }, 10000) } @@ -58,9 +54,7 @@ startOver = function() { if (tries < 10) { console.log("Try:", tries) tries++ procedure() } else { console.log("Finished whole program.") } -
KristerV revised this gist
Jan 1, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ /* This will expand all of the posts and comments that is in the view. It will take a lot of time! */ var previousScrollheight = 0 scrollDown = function() { -
KristerV created this gist
Jan 1, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ var previousScrollheight = 0 scrollDown = function() { var currentScrollheight = document.body.scrollHeight var canScroll = currentScrollheight - previousScrollheight previousScrollheight = document.body.scrollHeight if (canScroll !== 0) { window.scrollTo(0,currentScrollheight); } return canScroll } expandComments = function() { setTimeout(function(){ var foundLinks = 0 document.querySelectorAll('[href="#"]').forEach(function(item){ var whitelist = ["See more", "More option", "more comment", "replie"] var blacklist = ["Hide", " hidden", "u_0_19"] var blacklistRegexp = new RegExp(blacklist.join("|"), "i") var whitelistResult = new RegExp(whitelist.join("|"), "i").test(item.innerHTML) var blacklistResultHTML = !(blacklistRegexp.test(item.innerHTML)) var blacklistResultClass = !(blacklistRegexp.test(item.className)) var blacklistResultId = !(blacklistRegexp.test(item.id)) if (whitelistResult && blacklistResultHTML && blacklistResultClass && blacklistResultId) { foundLinks++ item.click() } }) console.log("foundLinks:", foundLinks) if (foundLinks > 0) expandComments() else startOver() }, 10 * 1000) } procedure = function() { setTimeout(function(){ var scrolled = scrollDown() var expanded = expandComments() console.log("Scrolled:", scrolled, ". Expanded:", expanded) if (scrolled !== 0 && expanded !== 0) { procedure() } else { console.log("Finished procedure") startOver() } }, 10000) } var tries = 0 startOver = function() { if (tries < 10) { console.log("Try:", tries) tries++ setTimeout(function(){ procedure() }, 1000 * 60 * 5) } else { console.log("Finished whole program.") } } startOver()