NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Open CodeProject Links
// @namespace http://hibbard.eu/
// @version 0.1
// @description Opens all links in the CodeProject newsletter
// @match https://www.instagram.com/*
// @copyright 2012+, hibbard.eu
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
$(document).ready(function() {
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
$('body').append('<input type="button" value="Open" id="CP">');
$("#CP").css("position", "fixed").css("top", 0).css("left", 0).css("z-index",99999);
$('#CP').click(function(){
var coo=true;
while(coo)
{
var elements = document.getElementsByClassName("_ah57t _84y62 _i46jh _rmr7s");
if(elements.length===0)
{
coo=false;
}
alert(elements.length);
for (var i = 4, len = 15; i < len; i++) {
sleep(5000);
var dd=elements[i];
dd.click();
}
}
});
});