mirror of
https://github.com/disposable-email-domains/disposable-email-domains.git
synced 2024-11-25 10:08:12 +08:00
add contrib
This commit is contained in:
parent
5e2713bc81
commit
3d4b47e03c
@ -13,7 +13,7 @@ The file [whitelist.conf](whitelist.conf) gathers email domains that are often i
|
|||||||
|
|
||||||
Example Usage
|
Example Usage
|
||||||
=============
|
=============
|
||||||
Python
|
**Python**
|
||||||
```Python
|
```Python
|
||||||
blacklist = ('disposable_email_blacklist.conf')
|
blacklist = ('disposable_email_blacklist.conf')
|
||||||
blacklist_content = [line.rstrip() for line in blacklist.readlines()]
|
blacklist_content = [line.rstrip() for line in blacklist.readlines()]
|
||||||
@ -23,7 +23,7 @@ if email.split('@')[1] in blacklist_content:
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
```
|
```
|
||||||
PHP contributed by @txt3rob and @deguif
|
**PHP** contributed by @txt3rob and @deguif
|
||||||
```php
|
```php
|
||||||
function is_temp_mail($mail) {
|
function is_temp_mail($mail) {
|
||||||
$mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
@ -32,7 +32,7 @@ function is_temp_mail($mail) {
|
|||||||
return in_array(explode('@', $mail)[1], $mail_domains_ko);
|
return in_array(explode('@', $mail)[1], $mail_domains_ko);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Ruby on Rails
|
**Ruby on Rails** contributed by @MitsunChieh
|
||||||
|
|
||||||
In resource model, usually it is `user.rb`
|
In resource model, usually it is `user.rb`
|
||||||
```Ruby
|
```Ruby
|
||||||
|
Loading…
Reference in New Issue
Block a user