Skip to content

Instantly share code, notes, and snippets.

@icodeforlove
Last active May 15, 2016 04:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save icodeforlove/690b1a5f09c1d3f85498 to your computer and use it in GitHub Desktop.
Save icodeforlove/690b1a5f09c1d3f85498 to your computer and use it in GitHub Desktop.
Endorse everyone on linkedin
(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