Skip to content

Instantly share code, notes, and snippets.

@datduyng
Created November 18, 2020 17:25
Show Gist options
  • Select an option

  • Save datduyng/6d12180b16fb485aef9eb9c3cf907867 to your computer and use it in GitHub Desktop.

Select an option

Save datduyng/6d12180b16fb485aef9eb9c3cf907867 to your computer and use it in GitHub Desktop.
//http://doors.stanford.edu/~sr/universities.html
let data = [];
for (let item of $("ol").children) {
if ( item instanceof HTMLLIElement) {
let inner = item.innerText;
let email_grp = inner.match(/\(([^)]+)\)/);
if (!email_grp || email_grp.length < 2) continue;
let email = email_grp[1];
let uname = inner.substr(0, inner.indexOf('(')).trim()
data.push({
uname: uname,
email: email
});
}
}
copy(data);
// then paste it to your editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment