swotphp

PHP port of https://github.com/leereilly/swot. Identify email addresses or domains names that belong to colleges or universities.

  • 所有者: mdwheele/swotphp
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Swot PHP :apple:

Build Status Latest Stable Version Total Downloads License

This is a port of the popular Ruby Gem, "Swot". As such, please do NOT make data contributions to this repository.
Contribute any new academic domain names to the Ruby version of this package at https://github.com/leereilly/swot.
Please follow the contribution guidelines noted on
Lee's repository.

I will be pulling changes to upstream domain data.

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.

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.

Installation

Install through Composer.

"require": {
    "mdwheele/swotphp": "dev-master"
}

Usage

The easiest way to get started with SwotPHP is to use a facade to access functionality. However, the base
implementation is present as a plain ol' PHP object in case developers want control over the construction themselves.
The implementation has an injected dependency on PHP Domain Parser,
an implementation of a URL parser backed by the Public Suffix List.

Framework-specific facades / service providers may be added later. The native facade is a good example of how
the object should be instantiated.

Native

require_once('vendor/autoload.php');

use SwotPHP\Facades\Native\Swot;

Verify Email Addresses

Swot::isAcademic('lreilly@stanford.edu')           # true
Swot::isAcademic('lreilly@strath.ac.uk')           # true
Swot::isAcademic('lreilly@soft-eng.strath.ac.uk')  # true
Swot::isAcademic('pedro@ugr.es')                   # true
Swot::isAcademic('lee@uottawa.ca')                 # true
Swot::isAcademic('lee@leerilly.net')               # false

Verify Domain Names

Swot::isAcademic('harvard.edu')              # true
Swot::isAcademic('www.harvard.edu')          # true
Swot::isAcademic('http://www.harvard.edu')   # true
Swot::isAcademic('http://www.github.com')    # false
Swot::isAcademic('http://www.rangers.co.uk') # false

Find School Names

Swot::schoolName('lreilly@cs.strath.ac.uk') -> "University of Strathclyde"
Swot::schoolName('http://www.stanford.edu') -> "Stanford University"

Known Issues

  • Lack of automated data import from Ruby gem's domain list.
  • There are architectural issues with the package resultant from differences in PHP and Ruby-isms. When I get time, there are two areas I'd like to focus on:
    1. Consolidate some of how the internal API flows while maintaining public interface.
    2. Implement a different mode of accessing the public suffix registry. Currently, the package is possibly abusing an excellent URL parser and I'd like to investigate the possibility of a separate component dedicated to modeling the Public Suffix registry's ruleset and algorithms.

主要指标

概览
名称与所有者mdwheele/swotphp
主编程语言PHP
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-07-14 05:44:43
推送于2023-05-08 09:31:57
最后一次提交2019-10-08 01:18:16
发布数8
最新版本名称1.0.1 (发布于 )
第一版名称0.1 (发布于 )
用户参与
星数67
关注者数5
派生数17
提交数43
已启用问题?
问题数7
打开的问题数1
拉请求数5
打开的拉请求数2
关闭的拉请求数12
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?