diff --git a/README.md b/README.md index 75a50437c4..c6936d53cb 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ nigel@stanford.edu, bawbag@cs.strath.ac.uk, lee@wunizar.es, terrence@ubishops.ca Swot::is_academic?('harvard.edu') # true Swot::is_academic?('www.harvard.edu') # true Swot::is_academic?('http://www.harvard.edu') # true - Swot::is_academic?('http://www.kink.com') # false + Swot::is_academic?('http://www.github.com') # false Swot::is_academic?('http://www.rangers.co.uk') # false ``` # What is a swot? diff --git a/lib/swot.rb b/lib/swot.rb index b01fd9fb44..3b61b2c6ed 100644 --- a/lib/swot.rb +++ b/lib/swot.rb @@ -152,6 +152,9 @@ module Swot end end + # Figure out the institution name based on the email address/domain. + # + # Returns a string with the instution name; nil if nothing is found. def get_institution_name(text) text.downcase! text = text.split("@")[1] if text.include? "@" @@ -183,7 +186,7 @@ module Swot # Get the FQDN name from a URL or email address. # - # + # Returns a string with the FQDN; nil if there's an error. def get_domain(text) return false if text.nil? text.downcase!