{"id":23383762,"url":"https://github.com/mdwheele/swotphp","last_synced_at":"2025-07-05T02:35:50.147Z","repository":{"id":18603754,"uuid":"21808745","full_name":"mdwheele/swotphp","owner":"mdwheele","description":"PHP port of https://github.com/leereilly/swot. Identify email addresses or domains names that belong to colleges or universities.","archived":false,"fork":false,"pushed_at":"2023-05-08T09:31:57.000Z","size":806,"stargazers_count":67,"open_issues_count":3,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-11T21:11:05.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdwheele.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-14T05:44:43.000Z","updated_at":"2024-04-05T06:48:49.000Z","dependencies_parsed_at":"2024-12-21T22:40:14.531Z","dependency_job_id":null,"html_url":"https://github.com/mdwheele/swotphp","commit_stats":{"total_commits":38,"total_committers":6,"mean_commits":6.333333333333333,"dds":"0.23684210526315785","last_synced_commit":"d2badf17aedc48ed6b249460271fa6dc6a3f24f8"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mdwheele/swotphp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fswotphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fswotphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fswotphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fswotphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdwheele","download_url":"https://codeload.github.com/mdwheele/swotphp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fswotphp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263671847,"owners_count":23494049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T22:29:47.701Z","updated_at":"2025-07-05T02:35:50.132Z","avatar_url":"https://github.com/mdwheele.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swot PHP :apple:\n\n[![Build Status](https://travis-ci.org/mdwheele/swotphp.svg?branch=master)](https://travis-ci.org/mdwheele/swotphp) [![Latest Stable Version](https://poser.pugx.org/mdwheele/swotphp/v/stable.svg)](https://packagist.org/packages/mdwheele/swotphp) [![Total Downloads](https://poser.pugx.org/mdwheele/swotphp/downloads.svg)](https://packagist.org/packages/mdwheele/swotphp) [![License](https://poser.pugx.org/mdwheele/swotphp/license.svg)](https://packagist.org/packages/mdwheele/swotphp)\n\nThis is a port of the popular Ruby Gem, \"Swot\".  As such, please do NOT make data contributions to this repository.\nContribute any new academic domain names to the Ruby version of this package at https://github.com/leereilly/swot.\nPlease follow the [contribution guidelines](https://github.com/leereilly/swot/blob/master/CONTRIBUTING.md) noted on \nLee's repository.\n\nI will be pulling changes to upstream domain data.\n\n\u003e If you have a product or service and offer **academic discounts**, there's a good chance there's some manual \n\u003e component to the approval process. Perhaps `.edu` email addresses are automatically approved because, for the most \n\u003e part at least, they're associated with American post-secondary educational institutions. Perhaps `.ac.uk` email \n\u003e addresses are automatically approved because they're guaranteed to belong to British universities and colleges. \n\u003e Unfortunately, not every country has an education-specific TLD (Top Level Domain) and plenty of schools use `.com` \n\u003e or `.net`.\n\n\u003e Swot is a community-driven or crowdsourced library for verifying that domain names and email addresses are tied to \n\u003e a legitimate university of college - more specifically, an academic institution providing higher education in \n\u003e tertiary, quaternary or any other kind of post-secondary education in any country in the world.\n\n### Installation\n\nInstall through Composer.\n\n```json\n\"require\": {\n    \"mdwheele/swotphp\": \"dev-master\"\n}\n```\n\n### Usage\n\nThe easiest way to get started with SwotPHP is to use a facade to access functionality.  However, the base\nimplementation is present as a plain ol' PHP object in case developers want control over the construction themselves.\nThe implementation has an injected dependency on [PHP Domain Parser](https://github.com/jeremykendall/php-domain-parser),\nan implementation of a URL parser backed by the [Public Suffix List](http://publicsuffix.org).\n\nFramework-specific facades / service providers may be added later.  The native facade is a good example of how\nthe object should be instantiated.\n\n**Native**\n\n```php\nrequire_once('vendor/autoload.php');\n\nuse SwotPHP\\Facades\\Native\\Swot;\n```\n\n#### Verify Email Addresses\n\n```php\nSwot::isAcademic('lreilly@stanford.edu')           # true\nSwot::isAcademic('lreilly@strath.ac.uk')           # true\nSwot::isAcademic('lreilly@soft-eng.strath.ac.uk')  # true\nSwot::isAcademic('pedro@ugr.es')                   # true\nSwot::isAcademic('lee@uottawa.ca')                 # true\nSwot::isAcademic('lee@leerilly.net')               # false\n```\n\n#### Verify Domain Names\n\n```ruby\nSwot::isAcademic('harvard.edu')              # true\nSwot::isAcademic('www.harvard.edu')          # true\nSwot::isAcademic('http://www.harvard.edu')   # true\nSwot::isAcademic('http://www.github.com')    # false\nSwot::isAcademic('http://www.rangers.co.uk') # false\n```\n\n#### Find School Names\n\n```php\nSwot::schoolName('lreilly@cs.strath.ac.uk') -\u003e \"University of Strathclyde\"\nSwot::schoolName('http://www.stanford.edu') -\u003e \"Stanford University\"\n```\n\n### Known Issues\n\n- Lack of automated data import from Ruby gem's domain list.\n- 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:\n    1. Consolidate some of how the internal API flows while maintaining public interface.\n    2. Implement a different mode of accessing the public suffix registry.  Currently, the package is possibly abusing an excellent [URL parser](https://github.com/jeremykendall/php-domain-parser) and I'd like to investigate the possibility of a separate component dedicated to modeling the Public Suffix registry's ruleset and algorithms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwheele%2Fswotphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdwheele%2Fswotphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwheele%2Fswotphp/lists"}