Connection request to LinkedIn profiles on search page
It doesn't sound like a great idea to run something infinitely.
Especially, doing $("a:contains('Next &gt;')")[0].click() periodically is flawed, because when there is no more Next links, the dom query will return empty result, the [0] index of which is undefined, and the .click() will throw a TypeError.

I suggest to make it possible to stop the periodic calls, especially the second one. See this related answer for a technique that you can use.



In this code, the parameters index and a of the anonymous function are never used:


$("a:contains('Connect')").each(function (index, a) {
    $(this).trigger('click');
});



You could omit them, using simply function () { in the function declaration.



Instead of using anonymous functions in the setInterval calls,
I suggest to use named functions, something like this:

var clickConnect = function() { ... };

var clickNext = function() { ... };

window.setInterval(clickConnect, 1000);
window.setInterval(clickNext, 5000);


When written this way, the window.setInterval calls are easier to read,
When using anonymous functions,
it can be hard to search for the delay parameter,
as you have to scan the code to see where the function ends and the delay parameter begins.