1

this may be out of the realm of stackoverflow, but I have a problem. I am trying to automatically insert the name of the College/University every one of my signups attends. They can only use a .edu email to signup and I was wondering If there were a way to see the College or University the email belonged to?

Ex:

morris@uakron.edu

Would return:

The University of Akron

Or does someone know where I could find such a directory?

Thanks

John Carter
  • 53,924
  • 26
  • 111
  • 144
user1759682
  • 247
  • 1
  • 4
  • 10

3 Answers3

2

You can populate a MySQL table with all the university names and their email domains. Here is a sample directory that you can perhaps start with.

Once you've done that, you can parse the user's email for the domain. Here is a very similar answer on how to get the domain name from an email address.

Once you have got the domain from the user's email, retrieve the university/college's name from the MySQL database. (If it does not exist, it's worth logging since it could be a new domain name that is not in your database yet)

Community
  • 1
  • 1
Aamir
  • 5,324
  • 2
  • 30
  • 47
1

Swot is a project (written in Ruby) that does exactly that. It checks that if a given email belongs to an educational institute (using a database filled with domain-names mapped to institute names).

Swot allows you to identify whether a particular email address or domain is associated with an academic institution providing higher education in tertiary, quaternary or post-secondary education in any country in the world.

You probably can utilize some parts of it in your code (Swot's database by itself is a great treasure).

Aziz
  • 20,065
  • 8
  • 63
  • 69
0

An alternative to looking it up in a table is to do a who-is search on the domain the email came from to find who it is registered to.

You can use a service like WhoisAPI to make the API calls and then parse the output for the registrant name. Might not always give exactly what you want, though.

sachleen
  • 30,730
  • 8
  • 78
  • 73