Skip to content

Instantly share code, notes, and snippets.

@ypcrts
Last active June 3, 2019 15:20
Show Gist options
  • Select an option

  • Save ypcrts/2a1f9043f12f7105e3a0b14a788f1f90 to your computer and use it in GitHub Desktop.

Select an option

Save ypcrts/2a1f9043f12f7105e3a0b14a788f1f90 to your computer and use it in GitHub Desktop.

Revisions

  1. ypcrts revised this gist Jun 3, 2019. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions linkedin_name_to_usernames.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    (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

    })();
  2. ypcrts created this gist Jun 3, 2019.
    7 changes: 7 additions & 0 deletions linkedin_name_scrape.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    (function () {
    var s = new Set();
    document.querySelectorAll('.actor-name').forEach( e=> {
    s.add(e.innerText)
    });
    console.log(s)
    })()