Last active
August 29, 2015 14:11
-
-
Save itslenny/ec1a98c872e46174ece2 to your computer and use it in GitHub Desktop.
Steal stories from watt pad 12/14/2014
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
//copy and paste in to javascript console | |
function wattTheif(){ | |
var story=""; | |
var curPage = 1; | |
var lastPage = -1; | |
function getPageText(){ | |
curPage = $('.paging_input').val(); | |
console.log('Reading page: '+curPage); | |
$('.textbody p').each(function(){ | |
story+='\r\n\r\n'+$(this).text(); | |
}); | |
nextPage(); | |
} | |
function nextPage(){ | |
nextPageClick(); | |
console.log("...pausing so we don't piss off the watt gods") | |
setTimeout(checkPage,2000); | |
} | |
function checkPage(){ | |
if(curPage==lastPage){ | |
console.log('HERE IS YOUR STORY!!'); | |
console.log(story); | |
}else{ | |
lastPage=curPage; | |
setTimeout(getPageText,1000); | |
} | |
} | |
getPageText(); | |
} | |
wattTheif(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment