Friday, September 9, 2016

Getting the Word Out: Building an Email Checker App with LiveCode to Remove Multiple or Bad Addresses from a Long List of Emails

For the past three years I've been teaching a MOOC about introductory statistics. In total, about 5800 people have enrolled. I've also been doing some research on MOOCs with this course as well. I'm happy to report that an "early view" of a research article I wrote is now available online through the British Journal of Educational Technology. Here's the link and citation:

Rieber, L. P. (2016). Participation patterns in a massive open online course (MOOC) about statistics. British Journal of Educational Technology. doi:10.1111/bjet.12504
(After the print version article is published, the citation will change to include the volume/issue and page numbers.)

Yes, this is great news, and my family - usually my only readers - are very proud. (Some people have spread a rumor that I hold nightly, mandatory readings of my research articles in my house. That's simply ridiculous - I stopped doing that years ago.) However, I do want to alert the people who enrolled in my MOOC over these past three about this article because it's really because of their help and support that I was able to do this research. Fortunately, I have all of the emails of every person who ever enrolled in the MOOC. So, I could just put all of these emails into a gigantic list and "bcc" them in an email with the information about the paper. And that is exactly what I will do.

But, although it is true that over 5800 people enrolled at one point or another, a good number of these enrollments were the same people. Some started the MOOC and didn't finish, but came back the next time it was offered to work on it some more. Some did this several times. So, I don't want to send two, three, or more copies of the same email to a person. That's a good way to really get someone angry, and I've spent a lifetime trying to avoid angry people (with only mixed success). Ok, simple enough - just check the list and remove any multiple entries. But, good golly, doing so manually with a list of 5800 would be a tough task and I would likely make many mistakes even if I tried. So, once again it's LiveCode to the rescue. I quickly built a simple app that scans a given list of emails and removes all of the duplicates. I also added the feature to subsequently have it scan a list of "bad email addresses" - those that bounce back for whatever reason. That way, I can refine the list to only those emails that actually work. The result is an edited list of email addresses that I can use - judiciously - to send other announcements to these people that I think are useful and would be warmly received.

The Email Checker App

Here's a snapshot of the ugly, but functional main card:

Yes, pretty ugly. But hey, I built this app quickly - an hour or two at most - for me to do an important job. No need to make it pretty. But, there is usability in the design. The red text are the directions I wrote to remind myself about how the darn thing works. I actually built this app about a year ago and knew at the time I wouldn't need to use it very frequently. Knowing how short my memory is, I was careful to write in the instructions so that any idiot - well, a specific idiot - could know what to do after opening the app. As anticipated, it is only now that I have another email that I think is worth sending to this group. I'm now very grateful to myself that I wrote those "notes to self" - hmm, am I being "self"-ish?  

How the App Works

After pasting in the list of emails into the far left field, there are three simple steps to cleaning the list of duplicates and non-email addresses:
  1. Sort the list. This puts exact copies of multiple emails sequentially in the list.
  2. Check for duplicates. This simply compares each line in the field with the one after it. If the two are a match, a bell rings and the email is deleted from the field on the left and placed in the field on the far right. I realized that if there are more than two duplicates in the list, then this step would need to repeated until all duplicates were found. I was rather lazy here because yes, I could have programmed the matching algorithm to just keep going if it found a duplicate. That is, if it finds one duplicate on the next line, then it should continue the comparing the next line with the same email. At some point, I may make this modification, but for my purposes, it's easy enough just to run step 2 as often as I need to catch all the duplicates.
  3. Check for the @ symbol. Finally, I found the occasional email entry that wasn't actually an email address. So, I added a step that checks each email for the @ symbol. Obviously, without this symbol, the email would not work.

Purging Bad Emails from the List 

After I send the email out, it is inevitable that some addresses won't work. Perhaps the person entered the email address incorrectly when they created their MOOC accounts, or they deleted the email account after the MOOC was over. Either way, I manually keep track of all emails that bounce back to me, then paste that list into the middle field on this card:

The end result is a nice, clean list of working emails.

Final Comments

I take very seriously the responsibility of having such a list of email addresses. I would never, ever consider giving or sharing this list with anyone. I don't know about you, but I am very hesitant of giving out one of my "good emails" to any group or organization because I'm always suspicious that my email will be sold or used for marketing purposes. (And yes, I do have some "throw-away" emails that work, technically, but I never check them. God only knows how much spam they have accumulated over the years.)

So, if you ever join a future section of my MOOC, please know that your email is safe with me. But, I hope you won't mind getting an email two or three times a year from me with information I think you really might want to have.

1 comment: