Skip to content

Instantly share code, notes, and snippets.

View abhishekdubey1's full-sized avatar

Abhishek Dubey abhishekdubey1

View GitHub Profile
@abhishekdubey1
abhishekdubey1 / linkedin-manage-requests
Last active April 13, 2021 01:46
Scroll down to comments to see how to use this code snippet
function manageRequests(acceptAll, ignoreAll, acceptCount){
let invitationsList = document.getElementsByClassName('mn-invitation-list')[0]
let requests = invitationsList.querySelectorAll('li')
let lengthOfRequests = requests.length
function alertUser(fnCall, count){
alert(`Hey User, you are about to ${fnCall} - ${count} connection requests`)
}
function handleRequests(num, count) {
for(let i=0; i<count; i++) {
requests[i].querySelector('.invitation-card__action-container').querySelectorAll('button')[num].click()