Last active
July 21, 2025 13:11
-
-
Save DaveyJake/88484d1eb4545ca96706721608c65828 to your computer and use it in GitHub Desktop.
LinkedIn Connections GeoURN: Every Country Outside America
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
/** | |
* On the contacts search results pages, use this function inside | |
* your DevTools console on every page of results. It will collect | |
* & store your contacts' user ID, name, and location (if provided) | |
* to your browser's `localStorage`. | |
*/ | |
function getConnections() { | |
const connections = []; | |
// Connection search results. | |
const itemList = document.querySelectorAll( '.search-results-container ul li div[data-chameleon-result-urn]' ); | |
const items = Array.from( itemList ); | |
items.forEach(( item, i ) => { | |
/** | |
* Connection object. | |
* | |
* @property {string} connection.uid Connection's user ID. | |
* @property {string} connection.name Connection's name. | |
* @property {string} connection.location Connection's location (if provided). | |
*/ | |
const connection = { | |
uid: item.dataset.chameleonResultUrn.slice( 'urn:li:member:'.length ), | |
name: item.querySelectorAll( '.linked-area > div > .pb3 > div > div:first-child a > span[dir="ltr"] > span[aria-hidden="true"]' )[0].textContent, | |
location: item.querySelectorAll( '.linked-area > div > .pb3 > div > div:last-child' )[0] ? | |
item.querySelectorAll( '.linked-area > div > .pb3 > div > div:last-child' )[0].textContent.trim() : | |
'' | |
}; | |
connections.push( connection ); | |
}); | |
// Save results to `localStorage` and update accordingly. | |
if ( localStorage.getItem( 'connections' ) === null ) { | |
localStorage.setItem( 'connections', JSON.stringify( connections ) ); | |
} else { | |
const oldResult = JSON.parse( localStorage.getItem( 'connections' ) ); | |
const result = oldResult.concat( connections ); | |
localStorage.removeItem( 'connections' ); | |
localStorage.setItem( 'connections', JSON.stringify( result ) ); | |
} | |
} | |
// Insert the function into the DOM. | |
window.getConnections = getConnections; | |
// Call the function and collect your data. | |
getConnections(); |
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
/** | |
* GeoURN Country IDs. | |
* | |
* Use inside the faceted URL when searching for your contacts | |
* outside of the United States (geoURN: "103644278"). | |
* | |
* @type Array<string> | |
*/ | |
const countryIDs = [ | |
"101367137", | |
"102120260", | |
"105962095", | |
"104246629", | |
"104195383", | |
"101490751", | |
"102185308", | |
"107734735", | |
"100867946", | |
"104305776", | |
"102264497", | |
"106943612", | |
"103609605", | |
"100771715", | |
"105449295", | |
"102105699", | |
"102134353", | |
"105646927", | |
"100212364", | |
"106947126", | |
"103603395", | |
"101101678", | |
"105146118", | |
"104604145", | |
"105925962", | |
"104187078", | |
"106714035", | |
"106693272", | |
"105117694", | |
"106768907", | |
"105530931", | |
"106740205", | |
"104980232", | |
"100446352", | |
"105646813", | |
"105149562", | |
"103665423", | |
"104035573", | |
"104725424", | |
"104980134", | |
"106137034", | |
"103119917", | |
"102454443", | |
"106524187", | |
"107007050", | |
"101855366", | |
"103587512", | |
"100459316", | |
"106867470", | |
"105730022", | |
"104031721", | |
"104703990", | |
"102024132", | |
"105392771", | |
"102098694", | |
"104022923", | |
"103547315", | |
"101728296", | |
"106670623", | |
"104265812", | |
"104170880", | |
"105245958", | |
"100364837", | |
"105072130", | |
"104322374", | |
"103121230", | |
"102927786", | |
"104065273", | |
"100808673", | |
"93000000", | |
"106779877", | |
"101022442", | |
"103619019", | |
"103819153", | |
"103666514", | |
"116224156", | |
"102139488", | |
"105365761", | |
"103550069", | |
"105517145", | |
"105490917", | |
"105535747", | |
"102890719", | |
"104630404", | |
"100348836", | |
"106682822", | |
"104136533", | |
"100474128", | |
"102356536", | |
"102787409", | |
"100733275", | |
"102396337", | |
"101352147", | |
"106178099", | |
"102762290", | |
"103323778", | |
"104097939", | |
"106950838", | |
"106931611", | |
"103091690", | |
"106516799", | |
"100961908", | |
"100770782", | |
"102161637", | |
"106808692", | |
"105992277", | |
"105587166", | |
"103420483", | |
"101316508", | |
"104042105", | |
"101464403", | |
"100878084", | |
"104036859", | |
"106579411", | |
"103712797", | |
"101834488", | |
"104341318", | |
"100664862", | |
"103490790", | |
"103239229", | |
"104640522", | |
"104742735", | |
"100710459", | |
"106049128", | |
"103710677", | |
"102705533", | |
"101355337", | |
"105126983", | |
"103295271", | |
"103350119", | |
"101620260", | |
"106316481", | |
"106725625", | |
"101934083", | |
"102478259", | |
"102713980", | |
"105238872", | |
"100288700", | |
"103291313", | |
"101937718", | |
"107163060", | |
"100737582", | |
"100993490", | |
"105836293", | |
"100152180", | |
"100115557", | |
"100099594", | |
"104019891", | |
"100877388", | |
"107006862", | |
"104232339", | |
"104579260", | |
"103705642", | |
"104677530", | |
"100674501", | |
"105769538", | |
"101282230", | |
"106315325", | |
"106100033", | |
"104471338", | |
"104827874", | |
"102681285", | |
"105001561", | |
"105015875", | |
"100456013", | |
"105733447", | |
"104630756", | |
"104961595", | |
"100212432", | |
"102974008", | |
"104219996", | |
"105141335", | |
"106522560", | |
"106155005", | |
"106373116", | |
"105057336", | |
"100720695", | |
"100371290", | |
"104514075", | |
"104508036", | |
"106774002", | |
"106429766", | |
"104688944", | |
"101739942", | |
"103118752", | |
"106796687", | |
"101271829", | |
"103069791", | |
"100876405", | |
"103188119", | |
"102893931", | |
"102890883", | |
"104621616", | |
"104655384", | |
"100134827", | |
"101679506", | |
"101679268", | |
"101174742", | |
"105745966", | |
"102500897", | |
"100800406", | |
"100587095", | |
"105333783", | |
"103809722", | |
"106498958", | |
"105534858", | |
"106057199", | |
"102127336", | |
"105698121", | |
"102869081", | |
"104379274", | |
"103613266", | |
"100061709", | |
"101519029", | |
"105912732", | |
"100565514", | |
"101705918", | |
"102118611", | |
"106215326", | |
"106662619", | |
"100425729", | |
"103226548", | |
"103883259", | |
"101452733", | |
"105763200", | |
"103030111", | |
"100446943", | |
"100270819", | |
"100428639", | |
"102287072", | |
"105371935", | |
"106296266", | |
"102431220", | |
"106395874", | |
"102845717", | |
"119365922", | |
"101240012", | |
"101165590", | |
"104738515", | |
]; | |
// LinkedIn Connections URL. | |
const url = `https://www.linkedin.com/search/results/people/?geoUrn=${countryIDs}&network=["F"]&origin=FACETED_SEARCH`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment