swot 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/CONTRIBUTING.md +64 -0
  2. data/LICENSE.txt +17 -3
  3. data/README.md +80 -46
  4. data/VERSION +1 -1
  5. data/lib/domains/ac.uk/manchester +1 -0
  6. data/lib/domains/edu/ggc +1 -0
  7. data/lib/swot.rb +121 -119
  8. data/swot.gemspec +5 -69
  9. data/test/test_swot.rb +5 -0
  10. metadata +6 -70
  11. data/Gemfile.lock +0 -42
  12. data/lib/domains/com/20m +0 -1
  13. data/lib/domains/com/8k +0 -1
  14. data/lib/domains/com/ackonline +0 -1
  15. data/lib/domains/com/aesom +0 -1
  16. data/lib/domains/com/aiu-online +0 -1
  17. data/lib/domains/com/american-college +0 -1
  18. data/lib/domains/com/andoncollege +0 -1
  19. data/lib/domains/com/bae-co +0 -1
  20. data/lib/domains/com/bosasocollege +0 -1
  21. data/lib/domains/com/bsmrau +0 -1
  22. data/lib/domains/com/cbu2000 +0 -1
  23. data/lib/domains/com/cubidor +0 -1
  24. data/lib/domains/com/donmeduni +0 -1
  25. data/lib/domains/com/eastsomaliauniversity +0 -1
  26. data/lib/domains/com/europeanopenuniversity +0 -1
  27. data/lib/domains/com/execpc +0 -1
  28. data/lib/domains/com/freeyellow +0 -1
  29. data/lib/domains/com/galeon +0 -1
  30. data/lib/domains/com/greenheartmed +0 -1
  31. data/lib/domains/com/groupe-esa +0 -1
  32. data/lib/domains/com/iaumehriz +0 -1
  33. data/lib/domains/com/indian +0 -2
  34. data/lib/domains/com/isctem +0 -1
  35. data/lib/domains/com/islamiccolleges +0 -1
  36. data/lib/domains/com/isvouga +0 -1
  37. data/lib/domains/com/itismalta +0 -1
  38. data/lib/domains/com/karuniversity +0 -1
  39. data/lib/domains/com/kgibbs +0 -1
  40. data/lib/domains/com/kirovballet +0 -2
  41. data/lib/domains/com/knightsbridgeuniversity +0 -1
  42. data/lib/domains/com/lansbridge +0 -1
  43. data/lib/domains/com/medcenterone +0 -1
  44. data/lib/domains/com/mednet +0 -2
  45. data/lib/domains/com/mozcom +0 -2
  46. data/lib/domains/com/murlin +0 -1
  47. data/lib/domains/com/netcomsa +0 -1
  48. data/lib/domains/com/nu-online +0 -1
  49. data/lib/domains/com/nulaoag +0 -1
  50. data/lib/domains/com/nutritioneducation +0 -1
  51. data/lib/domains/com/paierart +0 -1
  52. data/lib/domains/com/pakistanhomoeopathy +0 -1
  53. data/lib/domains/com/paralegal-education +0 -1
  54. data/lib/domains/com/sanaaguniversity +0 -1
  55. data/lib/domains/com/saskweb +0 -1
  56. data/lib/domains/com/satlink +0 -1
  57. data/lib/domains/com/schillerparis +0 -1
  58. data/lib/domains/com/siteobjects +0 -1
  59. data/lib/domains/com/sothebysinstitutelondon +0 -1
  60. data/lib/domains/com/soulsociety +0 -1
  61. data/lib/domains/com/trompo +0 -1
  62. data/lib/domains/com/ubcarrillo +0 -1
  63. data/lib/domains/com/ucaat +0 -1
  64. data/lib/domains/com/ulaicavr +0 -1
  65. data/lib/domains/com/umcollege +0 -1
  66. data/lib/domains/com/universiaperu +0 -1
  67. data/lib/domains/com/universidadpedagogica +0 -1
  68. data/lib/domains/com/universidadsanfrancisco +0 -1
  69. data/lib/domains/com/universityofbohol +0 -1
  70. data/lib/domains/com/unmuhmataram +0 -1
  71. data/lib/domains/com/uojazeera +0 -1
  72. data/lib/domains/com/usudbury +0 -1
  73. data/lib/domains/com/usurcolombia +0 -1
  74. data/lib/domains/com/utsha +0 -1
  75. data/lib/domains/com/vca1 +0 -1
  76. data/lib/domains/com/vvm +0 -1
  77. data/lib/domains/com/wesleycollege +0 -1
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,64 @@
1
+ # Contributing to Swot
2
+
3
+ #### Data Contributions
4
+
5
+ * All of the school data is stored in a simple filesystem data structure under `lib/domains`.
6
+ * Every directory name in here is a [TLD](http://en.wikipedia.org/wiki/Top-level_domain) (Top Level Domain) e.g. `edu`.
7
+ * Every file in these directories is named after the school's [SLD](http://en.wikipedia.org/wiki/Second-level_domain) (Second Level Domain) e.g `stanford`.
8
+ * The contents of that file are simply the school name e.g. `Stanford University`.
9
+ * The [working example for Stanford University](https://github.com/leereilly/swot/blob/master/lib/domains/edu/stanford) :eyes:
10
+ * Here's what the data structure looks like:
11
+
12
+ ```
13
+ [-] lib
14
+ [-] domains
15
+ [-] ac.uk
16
+ [+] strath
17
+ [-] edu
18
+ [+] harvard
19
+ [+] stanford
20
+
21
+ ```
22
+
23
+ ##### Adding a School
24
+
25
+ Let's say you want to add the [University of Strathclyde](http://www.strath.ac.uk/). We know the TLD is `ac.uk` and the SLD is `strath`. We'd simply create a file at `lib/domains/ac.uk/strath` containing the text `University of Strathcylde`. You can safely ignores subdomain like `www`, `cis`, whatever. You can see the actual file [here](https://github.com/leereilly/swot/blob/master/lib/domains/ac.uk/strath).
26
+
27
+ #### Updating a School Name
28
+
29
+ Change the file contents of the appropriate file.
30
+
31
+ #### Deleting a School Name
32
+
33
+ A simple `git rm` on the approriate file will do the trick.
34
+
35
+ #### Code Contributions
36
+
37
+ This was literally my first Ruby gem, so please keep that in mind when you're looking at the code :trollface:
38
+
39
+ * Check out the latest [master](https://github.com/leereilly/swot/tree/master).
40
+ * Take a look through the [open pull requests](https://github.com/leereilly/swot/issues) in case someone else has already contributed something similar.
41
+ * Fork the project.
42
+ * Start a topic branch of your own.
43
+ * Commit and push away. Don't forget the tests!
44
+ * Submit a pull request.
45
+ * :boom: You've contributed to open source!
46
+
47
+ ```
48
+ ____________________________________________________
49
+ |.==================================================,|
50
+ || I WILL MERGE AND REVIEW PULL REQUESTS QUICKLY ||
51
+ || I WILL MERGE AND REVIEW PULL REQUESTS QUICKLY ||
52
+ || I WILL MERGE AND REVIEW PULL REQUESTS QUICKLY ||
53
+ || I .----.ERG, ||
54
+ || / >< \ / ||
55
+ || | |/\ ||
56
+ || \______//\/ ||
57
+ || _(____)/ / ||
58
+ ||__/ ,_ _ _/______________________________________||
59
+ '===\___\_) |========================================'
60
+ |______|
61
+ | || |
62
+ |__||__|
63
+ (__)(__)
64
+ ```
data/LICENSE.txt CHANGED
@@ -1,7 +1,21 @@
1
+ The MIT License (MIT)
2
+
1
3
  Copyright (c) 2013 Lee Reilly
2
4
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
4
11
 
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
6
14
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,68 +1,102 @@
1
- Swot allows you to identify whether a particular email address or domain
2
- is associated with an academic institution providing higher education in
3
- tertiary, quaternary or post-secondary education in any country in the
4
- world.
1
+ # Swot :apple:
5
2
 
6
- # Why would you want to do that?
3
+ If you have a product or service and offer **academic discounts**, there's a good chance there's some manual component to the approval process. Perhaps `.edu` email addresses are automatically approved because, for the most part at least, they're associated with American post-secondary educational institutions. Perhaps `.ac.uk` email addresses are automatically approved because they're guaranteed to belong to British universities and colleges. Unfortunately, not every country has an education-specific TLD (Top Level Domain) and plenty of schools use `.com` or `.net`.
7
4
 
8
- Student discounts baby. A growing number of companies offer discounts on their products/services to those in academia. It's not a hard problem to solve in America or the UK, but other countries don't have domain name restrictions.
5
+ Swot is a community-driven or crowdsourced library for verifying that domain names and email addresses are tied to a legitimate university of college - more specifically, an academic institution providing higher education in tertiary, quaternary or any other kind of post-secondary education in any country in the world.
9
6
 
10
- ## Pop quiz
7
+ **Pop quiz:** Which of the following domain names should be eligible for an academic discount? `stanford.edu`, `america.edu`, `duep.edu`, `gla.ac.uk`, `wunizar.es`, `usask.ca`, `hil.no`, `unze.ba`, `fu-berlin.de`, `ecla.de`, `bvb.de`, `lsmu.com`. Answers at the foot of the page.
11
8
 
12
- How many of the following email addresses are associated with a university? Answers at the bottom.
9
+ ### Installation
13
10
 
14
- nigel@stanford.edu, bawbag@cs.strath.ac.uk, lee@wunizar.es, terrence@ubishops.ca, philip@usask.ca, hans@hil.no, mila@unze.ba
11
+ Swot is a Ruby gem, so you'll need a little Ruby-fu to get it working. Simply
15
12
 
16
- # Usage
13
+ `gem install swot`
14
+
15
+ Or add this to your `Gemfile` before doing a `bundle install`:
16
+
17
+ `gem 'swot'`
18
+
19
+ ### Usage
20
+
21
+ #### Verify Email Addresses
17
22
 
18
- ## Verify Email Addresses
19
23
  ```ruby
20
- Swot::is_academic?('lreilly@stanford.edu') # true
21
- Swot::is_academic?('lreilly@slac.stanford.edu') # true
22
- Swot::is_academic?('lreilly@strath.ac.uk') # true
23
- Swot::is_academic?('lreilly@soft-eng.strath.ac.uk') # true
24
- Swot::is_academic?('lee@ugr.es') # true
25
- Swot::is_academic?('lee@uottawa.ca') # true
26
- Swot::is_academic?('lee@leerilly.net') # false
27
- Swot::is_academic?('lee@gmail.com') # false
28
- Swot::is_academic?('lee@stanford.edu.com') # false
29
- Swot::is_academic?('lee@strath.ac.uk.com') # false
24
+ Swot::is_academic? 'lreilly@stanford.edu' # true
25
+ Swot::is_academic? 'lreilly@strath.ac.uk' # true
26
+ Swot::is_academic? 'lreilly@soft-eng.strath.ac.uk' # true
27
+ Swot::is_academic? 'pedro@ugr.es' # true
28
+ Swot::is_academic? 'lee@uottawa.ca' # true
29
+ Swot::is_academic? 'lee@leerilly.net' # false
30
30
  ```
31
- ## Verify Domain Names
31
+
32
+ #### Verify Domain Names
33
+
32
34
  ```ruby
33
- Swot::is_academic?('harvard.edu') # true
34
- Swot::is_academic?('www.harvard.edu') # true
35
- Swot::is_academic?('http://www.harvard.edu') # true
36
- Swot::is_academic?('http://www.github.com') # false
37
- Swot::is_academic?('http://www.rangers.co.uk') # false
35
+ Swot::is_academic? 'harvard.edu' # true
36
+ Swot::is_academic? 'www.harvard.edu' # true
37
+ Swot::is_academic? 'http://www.harvard.edu' # true
38
+ Swot::is_academic? 'http://www.github.com' # false
39
+ Swot::is_academic? 'http://www.rangers.co.uk' # false
38
40
  ```
39
- # What is a swot?
40
41
 
41
- [UrbanDictionary will fill you in](http://www.urbandictionary.com/define.php?term=swot) ಠ_ಠ
42
+ #### Find School Names
43
+
44
+ ```ruby
45
+ Swot::school_name 'lreilly@cs.strath.ac.uk'
46
+ # => "University of Strathclyde"
47
+
48
+ Swot::school_name 'http://www.stanford.edu'
49
+ # => "Stanford University"
50
+ ```
42
51
 
43
- # Contributing to Swot
52
+ ### Contributing to Swot
44
53
 
45
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
46
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
47
- * Fork the project.
48
- * Start a feature/bugfix branch.
49
- * Commit and push until you are happy with your contribution.
50
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
51
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
54
+ Contributions welcome! Please see the [contribution guidelines](CONTRIBUTING.md) for details on how to add, update, or delete schools. Code contributions welcome too. Ports to different languages welcome too.
52
55
 
53
- # Known Issues / Bugs / "Features"
56
+ **Thanks** to the following people for their contributions:
57
+ @blutack, @captn3m0, @johndbritton, @johnotander, @pborreli, @rcurtis, @vikhyat,.
58
+
59
+ **Special thanks** to @weppos for the [public_suffix](https://github.com/weppos/publicsuffix-ruby) gem :metal:
60
+
61
+ ### Known Issues
54
62
 
55
63
  * You can search by email and domain names only. You cannot search by IP.
56
- * You don't know if the email address belongs to a student, faculty, staff member, etc.
57
- * There may be a few false positives, missing institutions... maybe even a couple of typos.
64
+ * You don't know if the email address belongs to a student, faculty, staff member, alumni, or a contractor.
65
+ * There may be a few false positives, missing institutions... maybe even a couple of typos. Contributions welcome!
66
+
67
+ **Please note:** just because someone has verified that they own `lreilly@stanford.edu` does *not* mean that they're a student. They could be faculty, staff, alumnni, or maybe even an external contractor. If you're suddenly getting a lot of traffic from websites like [FatWallet](http://www.fatwallet.com) or [SlickDeals](http://www.slickdeals.net), you might want to find out why. If you're suddenly getting a lot of requests from a particular school, you should look into that too. It may be good business, word of mouth, or someone may have found a loophole. Swot gives you a *high confidence level* - not a guarantee. I recommend putting some controls in place or at least monitor how it's doing from time to time.
68
+
69
+ ### What is a swot?
70
+
71
+ According to [UrbanDictionary](http://www.urbandictionary.com/define.php?term=swot) :blue_book:
72
+
73
+ > A word used by morons to insult a person of superior academic abilities.
74
+
75
+ or
76
+
77
+ > [verb] To Swot; Revision undertaken preceding an examination.
78
+
79
+ or
58
80
 
59
- ![](http://i.imgur.com/K8vsw.gif)
81
+ > [anagram] Stupid Waste of Time
60
82
 
61
- # Copyright
83
+ ### Pop Quiz Answers
62
84
 
63
- Copyright (c) 2012 Lee Reilly. See LICENSE.txt for
64
- further details.
85
+ Hopefully, you'll be surprised by some of this:
65
86
 
66
- # Pop Quiz Answers
87
+ | Domain | Academic? | Comments |
88
+ |--------|-----------|----------|
89
+ |`stanford.edu`|:heavy_check_mark:|OK, this was an easy one so you could get at least *one* right|
90
+ |`america.edu`|:heavy_multiplication_x:| Prior to October 29th 2001, anyone could register a `.edu` domain name ([details](http://en.wikipedia.org/wiki/.edu#Grandfathered_uses)) |
91
+ |`duep.edu`|:heavy_check_mark:| Alfred Nobel University is a *Ukranian* University *in the Ukraine* i.e. not in the USA :us: |
92
+ |`gla.ac.uk`|:heavy_check_mark:|Glasgow University in Scotland|
93
+ |`unizar.es`|:heavy_check_mark:|The University of Zaragoza in Spain|
94
+ |`usask.ca`|:heavy_check_mark:|The University of Saskatchewan in Canada|
95
+ |`hil.no`|:heavy_check_mark:|Lillehammer University College in Norway|
96
+ |`unze.ba`|:heavy_check_mark:|University of Zenica in Bosnia and Herzegovina|
97
+ |`fu-berlin.de`|:heavy_check_mark:|Free University of Berlin in Germany|
98
+ |`ecla.de`|:heavy_check_mark:|ECLA of Bard is a state recognized liberal arts university in Berlin, Germany |
99
+ |`bvb.de`|:heavy_multiplication_x:|It's a soccer team from Germany|
100
+ |`lsmu.com`|:heavy_check_mark:| Lugansk State Medical University in the Ukraine |
67
101
 
68
- All of 'em.
102
+ If you verified this by visiting all of the websites, how long did it take you? Did you have fun? Imagine you had to do this 10 - 100 times every day. Now you know a little something about the inspiration for Swot. Swot can verify them all in a fraction of a second and remove a :poop: part of someone's job.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.10
1
+ 0.2.11
@@ -0,0 +1 @@
1
+ University of Manchester
@@ -0,0 +1 @@
1
+ Georgia Gwinnett College
data/lib/swot.rb CHANGED
@@ -4,124 +4,124 @@ module Swot
4
4
  VERSION = "0.1.0"
5
5
 
6
6
  # These top-level domains are guaranteed to be academic institutions.
7
- ACADEMIC_TLDS = [
8
- 'ac.ae',
9
- 'ac.at',
10
- 'ac.bd',
11
- 'ac.be',
12
- 'ac.cr',
13
- 'ac.cy',
14
- 'ac.fj',
15
- 'ac.id',
16
- 'ac.il',
17
- 'ac.ir',
18
- 'ac.jp',
19
- 'ac.ke',
20
- 'ac.kr',
21
- 'ac.ma',
22
- 'ac.mu',
23
- 'ac.mw',
24
- 'ac.mz',
25
- 'ac.nz',
26
- 'ac.pa',
27
- 'ac.pg',
28
- 'ac.rs',
29
- 'ac.ru',
30
- 'ac.rw',
31
- 'ac.th',
32
- 'ac.tz',
33
- 'ac.ug',
34
- 'ac.uk',
35
- 'ac.yu',
36
- 'ac.za',
37
- 'ac.zm',
38
- 'ac.zw',
39
- 'edu',
40
- 'edu.af',
41
- 'edu.al',
42
- 'edu.ar',
43
- 'edu.au',
44
- 'edu.az',
45
- 'edu.ba',
46
- 'edu.bb',
47
- 'edu.bd',
48
- 'edu.bh',
49
- 'edu.bi',
50
- 'edu.bn',
51
- 'edu.bo',
52
- 'edu.br',
53
- 'edu.bs',
54
- 'edu.bt',
55
- 'edu.bz',
56
- 'edu.co',
57
- 'edu.cu',
58
- 'edu.do',
59
- 'edu.dz',
60
- 'edu.ec',
61
- 'edu.ee',
62
- 'edu.eg',
63
- 'edu.er',
64
- 'edu.es',
65
- 'edu.et',
66
- 'edu.ge',
67
- 'edu.gh',
68
- 'edu.gr',
69
- 'edu.gt',
70
- 'edu.hk',
71
- 'edu.hn',
72
- 'edu.ht',
73
- 'edu.iq',
74
- 'edu.jm',
75
- 'edu.jo',
76
- 'edu.kg',
77
- 'edu.kh',
78
- 'edu.kn',
79
- 'edu.kw',
80
- 'edu.ky',
81
- 'edu.kz',
82
- 'edu.la',
83
- 'edu.lb',
84
- 'edu.lv',
85
- 'edu.ly',
86
- 'edu.mk',
87
- 'edu.mm',
88
- 'edu.mn',
89
- 'edu.mo',
90
- 'edu.mt',
91
- 'edu.mx',
92
- 'edu.my',
93
- 'edu.ni',
94
- 'edu.np',
95
- 'edu.om',
96
- 'edu.pa',
97
- 'edu.pe',
98
- 'edu.ph',
99
- 'edu.pk',
100
- 'edu.pl',
101
- 'edu.pr',
102
- 'edu.ps',
103
- 'edu.pt',
104
- 'edu.py',
105
- 'edu.qa',
106
- 'edu.rs',
107
- 'edu.ru',
108
- 'edu.sa',
109
- 'edu.sd',
110
- 'edu.sg',
111
- 'edu.sv',
112
- 'edu.sy',
113
- 'edu.tr',
114
- 'edu.tt',
115
- 'edu.tw',
116
- 'edu.ua',
117
- 'edu.uy',
118
- 'edu.ve',
119
- 'edu.vn',
120
- 'edu.ws',
121
- 'edu.ye',
122
- 'edu.zm',
123
- 'vic.edu.au'
124
- ]
7
+ ACADEMIC_TLDS = {
8
+ 'ac.ae' => 1,
9
+ 'ac.at' => 1,
10
+ 'ac.bd' => 1,
11
+ 'ac.be' => 1,
12
+ 'ac.cr' => 1,
13
+ 'ac.cy' => 1,
14
+ 'ac.fj' => 1,
15
+ 'ac.id' => 1,
16
+ 'ac.il' => 1,
17
+ 'ac.ir' => 1,
18
+ 'ac.jp' => 1,
19
+ 'ac.ke' => 1,
20
+ 'ac.kr' => 1,
21
+ 'ac.ma' => 1,
22
+ 'ac.mu' => 1,
23
+ 'ac.mw' => 1,
24
+ 'ac.mz' => 1,
25
+ 'ac.nz' => 1,
26
+ 'ac.pa' => 1,
27
+ 'ac.pg' => 1,
28
+ 'ac.rs' => 1,
29
+ 'ac.ru' => 1,
30
+ 'ac.rw' => 1,
31
+ 'ac.th' => 1,
32
+ 'ac.tz' => 1,
33
+ 'ac.ug' => 1,
34
+ 'ac.uk' => 1,
35
+ 'ac.yu' => 1,
36
+ 'ac.za' => 1,
37
+ 'ac.zm' => 1,
38
+ 'ac.zw' => 1,
39
+ 'edu' => 1,
40
+ 'edu.af' => 1,
41
+ 'edu.al' => 1,
42
+ 'edu.ar' => 1,
43
+ 'edu.au' => 1,
44
+ 'edu.az' => 1,
45
+ 'edu.ba' => 1,
46
+ 'edu.bb' => 1,
47
+ 'edu.bd' => 1,
48
+ 'edu.bh' => 1,
49
+ 'edu.bi' => 1,
50
+ 'edu.bn' => 1,
51
+ 'edu.bo' => 1,
52
+ 'edu.br' => 1,
53
+ 'edu.bs' => 1,
54
+ 'edu.bt' => 1,
55
+ 'edu.bz' => 1,
56
+ 'edu.co' => 1,
57
+ 'edu.cu' => 1,
58
+ 'edu.do' => 1,
59
+ 'edu.dz' => 1,
60
+ 'edu.ec' => 1,
61
+ 'edu.ee' => 1,
62
+ 'edu.eg' => 1,
63
+ 'edu.er' => 1,
64
+ 'edu.es' => 1,
65
+ 'edu.et' => 1,
66
+ 'edu.ge' => 1,
67
+ 'edu.gh' => 1,
68
+ 'edu.gr' => 1,
69
+ 'edu.gt' => 1,
70
+ 'edu.hk' => 1,
71
+ 'edu.hn' => 1,
72
+ 'edu.ht' => 1,
73
+ 'edu.iq' => 1,
74
+ 'edu.jm' => 1,
75
+ 'edu.jo' => 1,
76
+ 'edu.kg' => 1,
77
+ 'edu.kh' => 1,
78
+ 'edu.kn' => 1,
79
+ 'edu.kw' => 1,
80
+ 'edu.ky' => 1,
81
+ 'edu.kz' => 1,
82
+ 'edu.la' => 1,
83
+ 'edu.lb' => 1,
84
+ 'edu.lv' => 1,
85
+ 'edu.ly' => 1,
86
+ 'edu.mk' => 1,
87
+ 'edu.mm' => 1,
88
+ 'edu.mn' => 1,
89
+ 'edu.mo' => 1,
90
+ 'edu.mt' => 1,
91
+ 'edu.mx' => 1,
92
+ 'edu.my' => 1,
93
+ 'edu.ni' => 1,
94
+ 'edu.np' => 1,
95
+ 'edu.om' => 1,
96
+ 'edu.pa' => 1,
97
+ 'edu.pe' => 1,
98
+ 'edu.ph' => 1,
99
+ 'edu.pk' => 1,
100
+ 'edu.pl' => 1,
101
+ 'edu.pr' => 1,
102
+ 'edu.ps' => 1,
103
+ 'edu.pt' => 1,
104
+ 'edu.py' => 1,
105
+ 'edu.qa' => 1,
106
+ 'edu.rs' => 1,
107
+ 'edu.ru' => 1,
108
+ 'edu.sa' => 1,
109
+ 'edu.sd' => 1,
110
+ 'edu.sg' => 1,
111
+ 'edu.sv' => 1,
112
+ 'edu.sy' => 1,
113
+ 'edu.tr' => 1,
114
+ 'edu.tt' => 1,
115
+ 'edu.tw' => 1,
116
+ 'edu.ua' => 1,
117
+ 'edu.uy' => 1,
118
+ 'edu.ve' => 1,
119
+ 'edu.vn' => 1,
120
+ 'edu.ws' => 1,
121
+ 'edu.ye' => 1,
122
+ 'edu.zm' => 1,
123
+ 'vic.edu.au' => 1,
124
+ }
125
125
 
126
126
  class << self
127
127
 
@@ -136,7 +136,7 @@ module Swot
136
136
  domain = get_domain(text)
137
137
  return false if domain.nil?
138
138
 
139
- if ACADEMIC_TLDS.include?(domain.tld)
139
+ if ACADEMIC_TLDS[domain.tld]
140
140
  true
141
141
  elsif match_academic_domain?(domain)
142
142
  true
@@ -151,6 +151,7 @@ module Swot
151
151
  return false
152
152
  end
153
153
  end
154
+ alias_method :academic?, :is_academic?
154
155
 
155
156
  # Figure out the institution name based on the email address/domain.
156
157
  #
@@ -162,6 +163,7 @@ module Swot
162
163
  domain = PublicSuffix.parse(text)
163
164
  name_from_academic_domain(domain)
164
165
  end
166
+ alias_method :school_name, :get_institution_name
165
167
 
166
168
  # Figure out if a domain name is a know academic institution.
167
169
  #