Last active
May 15, 2016 04:23
-
-
Save icodeforlove/690b1a5f09c1d3f85498 to your computer and use it in GitHub Desktop.
Endorse everyone on linkedin
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 characters
(function () { | |
var csrfToken = $('[name="csrfToken"]').val(); | |
$.getJSON('https://www.linkedin.com/hp/modules/ozfeed/promo/endorsements/fetch?offset=0&count=500', function (response) { | |
var endorsements = response.endorsements; | |
console.log('found ' + endorsements.length + ' endorsements'); | |
function endorse (callback) { | |
var endorsement = endorsements.shift(); | |
if (!endorsement) { | |
return console.log('done'); | |
} | |
console.log('endorsing "' + endorsement.endorsee.fullName + '" for "' + endorsement.skillName + '"'); | |
$.post('https://www.linkedin.com/hp/modules/ozfeed/promo/endorsements/accept', { | |
csrfToken: csrfToken, | |
signature: endorsement.signature | |
}, function (response) { | |
setTimeout(function () { | |
endorse(); | |
}, 4000 + Math.random() * 2000) | |
}); | |
} | |
endorse(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment