Skip to content

Instantly share code, notes, and snippets.

@codeliger
Last active November 11, 2019 15:22
Show Gist options
  • Save codeliger/5279b787ad750cee1d11a37e8dc3bfdc to your computer and use it in GitHub Desktop.
Save codeliger/5279b787ad750cee1d11a37e8dc3bfdc to your computer and use it in GitHub Desktop.
Views the profile of each female on interpals.
var females = $('a.female');
var length = females.length;
var count = 0;
var at_page = false
$.each(females, function(index, value){
console.log("Getting female");
var female = females[index];
var url = "https://www.interpals.net" + $(female).attr("href").split("?")[0];
$.get(url, function(){
count++;
console.log("Viewed " + count + " out of " + length + " profiles. (" + url + ")");
if(count == length){
console.info("Operation Ended.");
$('.pages').children().each(function(index, value){
if($(value).hasClass('cur_page')){
console.log('Now at page')
at_page = true
return true;
}else if(at_page){
console.log(value)
value.click();
return false
}else{
console.log(value.href)
}
});
}
});
});
console.log("Finished.");
var females = $('.online_prof');
var length = females.length;
var count = 0;
console.info("Operation started.");
if($){
$.each(females, function(index, value){
console.log("Getting female");
var female = females[index];
var url = "https://www.interpals.net" + $(female).children().eq(0).attr("href");
$.get(url, function(){
count++;
console.log("Viewed " + count + " out of " + length + " profiles. (" + url + ")");
if(count == length){
console.info("Operation Ended.");
}
});
});
}else{
console.error("No jquery defined.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment