Skip to content

Instantly share code, notes, and snippets.

@ypcrts
Last active June 3, 2019 15:20
Show Gist options
  • Save ypcrts/2a1f9043f12f7105e3a0b14a788f1f90 to your computer and use it in GitHub Desktop.
Save ypcrts/2a1f9043f12f7105e3a0b14a788f1f90 to your computer and use it in GitHub Desktop.
LinkedIn Name Scraping
(function () {
var s = new Set();
document.querySelectorAll('.actor-name').forEach( e=> {
s.add(e.innerText)
});
console.log(s)
})()
(function () {
var q = [ "John Smith, "Wretchéd Hôrse" ]
for (let i=0; i < q.length; i++) {
const fullname = q[i].split(",")[0].toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, "");
const names = fullname.split(" ");
const first = names[0];
const family = names[1];
q[i] = first[0] + family;
}
console.log(q)
return q
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment