Skip to content

Instantly share code, notes, and snippets.

@glenndevenish
Last active December 12, 2017 13:24
Show Gist options
  • Save glenndevenish/9d34f9aa3f7deef6cd6a31dc41ff4399 to your computer and use it in GitHub Desktop.
Save glenndevenish/9d34f9aa3f7deef6cd6a31dc41ff4399 to your computer and use it in GitHub Desktop.
Automatically click 'connect' on every LinkedIn search result on the page.
/*
Automatically click 'connect' on every LinkedIn search result on the page.
Enter in the console, and click 'Send now' quickly on each one.
Requires jQuery, which is automatically loaded.
2.0 Features:
Selectively click on people with words in their profile (only works on the suggestions page)
Remove irrelevant suggestions from list
Reload page after clicking
*/
var words = ["landscap", "horti", "nurser", "ground", "garden", "plant", "arbor", "tree"]
$(".mn-pymk-list__card").each(
function(i, obj) {
if(new RegExp(words.join("|")).test($(obj).text().toLowerCase())) {
if($(obj).children("div").children("div").children(".button-secondary-small").text().indexOf("Connect") > -1) {
$(obj).children("div").children("div").children(".button-secondary-small").trigger('click');
}
} else {
$(obj).children("div").children(".mn-pymk-list__close-btn").trigger('click');
}
}
)
location.reload()
@glenndevenish
Copy link
Author

glenndevenish commented Nov 17, 2017

This revision also works in the 'People you may know' section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment