Skip to content

Instantly share code, notes, and snippets.

@enjoythecode
Last active August 19, 2020 22:53
Show Gist options
  • Save enjoythecode/14ba84b140f33fdb555dcf7fbdaa7f94 to your computer and use it in GitHub Desktop.
Save enjoythecode/14ba84b140f33fdb555dcf7fbdaa7f94 to your computer and use it in GitHub Desktop.

Harvest Roster Email Easily

Don't want to type in emails by hand? Here is how to automate that:

  1. Create a new bookmark in your browser (doesn't matter what page).
  2. Edit the bookmark URL to be code given below.
  3. Click on the bookmark when you have the roster page (the page with all the photos and information) open.

This will produce a semicolon-separated list of emails. Paste this to the recipient field of your email client.

I just saved you at least 5 minutes. Go listen to your favorite song with your free time :)

The Code

Starts below.

javascript:for(var table=document.getElementsByTagName("table")[0],rows=table.children[0].children,emails=[],i=1;i<rows.length;i++)for(var row=rows[i],columns=row.children,j=1;j<columns.length;j+=2){var info=columns[j].children[0].children[0],email=info.children[2].children[1].children[0].textContent;email=email.replace(/ /g,"")+"@colby.edu",emails.push(email)}window.prompt("copy the below text, and use it in the input field of your favorite email client",emails.join("; "));

Make sure you copy it completely.

Credits

Made by Sinan Yumurtaci' 23 to avoid manual work during covid-19 quarantine while drinking soup.
This will stop working if the page layout is updated, so it should be good for quite a few years.
Please don't misusespam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment