Skip to content

Instantly share code, notes, and snippets.

@itslenny
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itslenny/ec1a98c872e46174ece2 to your computer and use it in GitHub Desktop.
Save itslenny/ec1a98c872e46174ece2 to your computer and use it in GitHub Desktop.
Steal stories from watt pad 12/14/2014
//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