Automating my job search


The first step was to find a list of emails for companies I wanted to apply to. CrunchBase is great for this. With a free trial they allow you to search for a list of companies against filters like date founded, number of employees etc.

Unfortunately, that’s where the free trial ends. In order to export your now filtered list you need to “upgrade” your free trial and pay about £250. No thanks. To get around this I first highlighted all the companies whose emails I wanted and copied that information into notepad. At first I tried MS Word but discovered that notepad is significantly faster for processing large amounts of text.

All the text is raw and so I needed a way to filter out only the emails. After some googling I came across this script on github. I ran the script after selecting which companies in particular I wanted to contact.

from optparse import OptionParser
import os.path
import re

regex = re.compile(("([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`"
                    "{|}~-]+)*(@|\sat\s)(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(\.|"
                    "\sdot\s))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)"))

def file_to_str(filename):
    """Returns the contents of filename as a string."""
    with open(filename) as f:
        return f.read().lower() # Case is lowered to prevent regex mismatches.

def get_emails(s):
    """Returns an iterator of matched emails found in string s."""
    # Removing lines that start with '//' because the regular expression
    # mistakenly matches patterns like 'http://foo@bar.com' as '//foo@bar.com'.
    return (email[0] for email in re.findall(regex, s) if not email[0].startswith('//'))

if __name__ == '__main__':
    parser = OptionParser(usage="Usage: python %prog [FILE]...")
    # No options added yet. Add them here if you ever need them.
    options, args = parser.parse_args()

    if not args:
        parser.print_usage()
        exit(1)

    for arg in args:
        if os.path.isfile(arg):
            for email in get_emails(file_to_str(arg)):
                print(email)
        else:
            print('"{}" is not a file.'.format(arg))
            parser.print_usage()`

This script very neatly pulled out all of the emails.

Next up is verifying that those emails work. Hunter.io is the perfect tool for this. I copied the emails into their bulk verifier and let them do the work.

Once I got the list of verified emails the last step is to send out a campaign using those emails. Hunter.io provides this functionality too.

Categories: