Rapportive is no longer available, so this script no longer works
I just released my Find-Any-Email Ruby Script online a few days ago, and it has been picked up by a few people in the ruby community. In a little over a day, I have 101 stars, 15 forks, and over 3,000 views on the GitHub repo. Its my first time experiencing people using something I made at this scale.
That being said, credit must be given where credit is due. I stand on the shoulder of giants after all. I borrowed heavily from Jordan Wright’s Rapportive.py. I wasn’t too familiar with Python, so I ported it into Ruby. I got the idea for the name permutations from Distilled.net’s post about How To Find (Almost) Anybody’s Email Address. And honorable mention to Eric Wang’s post about how to get a startup job for a ‘guide’ on getting a job and hustling.
I used the manual process of hovering over each email within gmail with the rapportive plugin previously to get my internship in Tokyo. Now that I’m in San Francisco, I thought I’d repeat the process again here. After finding companies I would be interested working for, I searched for the highest person’s email address. Then I sent them a cold email. Not surprisingly some ignored my email, but some answered and were interested in meeting. After hovering over hundreds of email address, I got tired of it.
Then I remembered I knew how to program, so I could programmatically solve my own problem. That’s when I searched for Rapportive API and found Jordan Wright’s blog post. It’s a great read and way to learn how a security engineer works. Because of the similarities between Ruby and Python, I could fairly easily understand the code. Then I started searching for what the Ruby equivalent would be for some methods. Methods like Python’s request() to Ruby’s OpenURI library. I found porting a Python script into Ruby to be good exercise to understand both languages better.
Problems arose when I tried to port everything one-to-one. Some requests to Rapportive’s API were giving 429 and 403 errors. 429: Too many Requests, 403: Forbidden. In order to by pass this, I implemented a begin and rescue block with exponential backoff. Initially I didn’t even know about the concept of Exponential Backoff until I went a meetup downtown and someone suggested that I use it. I’m really grateful for learning about that because it’s so useful when working with APIs! Another note about the 429 and 403 errors, most of the time if these errors comes up, then the email does not have a person associated with them.
The emails were created using the permutate method which is given the arguments of first_name, last_name, and domain. Implementing the permutations and a method to loop each one into the request was the biggest contributions I had to this emailing finding technique. I was going to allow for the middle name argument, but decided against it after running into some problems when its left blank. The permutate method bothers me alittle because I can’t help but feel there is a better way of doing this. I have opened a question on stackoverflow, but I have not received a decent answer. In this part, I’m open to suggestions.
Comments have arisen about the morality of making such a script public. My response is that this technique has already be public for a long time before this script was published. Since this script borrows heavily from Rapportive.py, there is nothing that prevented people from doing this before. Even at a lower level, people aren’t going to email someone without a purpose. Example, Mark Cuban’s email is public, but I’m not going to spam him because it would be a waste of his and my time if I have nothing interesting to email about. It really just gives this technique exposure to Rubyist.
Another point is that this script is admittedly imperfect. Some valid email address are being skipped because Rapportive’s API is returning an error. You could possibly cross reference Rapportive’s API with gravatar’s or any other services’s API. Also every valid email is outputted instead of the one that you’re really looking for. To solve this, you could check that the name in the response matches with the inputted first and last name. I have opened bug issues on GitHub noting these problems. Because of these issues, I use this script as the first pass before doing it manually.
This the first time I pushed something online where I got this attention. It gets me excited to make more things and releasing it to the public.
Questions, comments, or concerns?
Follow me on Twitter¯
Bitcoin donation appreciated