You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
" [email protected]" doesn't look like a valid email address. (1149)
" [email protected]" doesn't look like a valid email address. (1154)
" [email protected]" doesn't look like a valid email address. (1156)
" [email protected]" doesn't look like a valid email address. (1162)
" [email protected]" doesn't look like a valid email address. (1168)
" [email protected]" doesn't look like a valid email address. (1171)
" [email protected]" doesn't look like a valid email address. (1179)
" [email protected]" doesn't look like a valid email address. (1310)
"siham–[email protected]" doesn't look like a valid email address. (1454)
"[email protected][email protected]" doesn't look like a valid email address. (1549)
"m" doesn't look like a valid email address. (2301)
"wahid" doesn't look like a valid email address. (2325)
(Where the parenthesis'ed digits are approximate line numbers.)
And here's my magical linting code:
'use strict';varfs=require('fs');varpath=require('path');varisEmail=require('isemail');varspamListDir=path.join(__dirname,'spam_lists');fs.readdir(spamListDir,function(err,files){if(err){throwerr;}files.forEach(function(file){vardata=fs.readFileSync(path.join(spamListDir,file),'utf8');varemails=data.split('\n');console.log('BEFORE: %d',emails.length);emails=emails.filter(function(email){return!(/^(#|!|\n)/.test(email));});console.log('AFTER: %d',emails.length);emails.forEach(function(email,idx){if(!isEmail(email)){console.log('"%s" doesn\'t look like a valid email address. (%d)',email,idx);}});});});
Note: You'll need to do a npm i isemail -D to install the isemail module.
There are a few interesting results:
Some email addresses have leading/trailing whitespace (easy to fix, just use trim())
Some aren't emails at all.
One is missing a line break.
Obviously, all easy to fix locally, but if you're [manually] scraping this from the remote blogspot site, it may be moot (unless you can get it changed upstream).
The text was updated successfully, but these errors were encountered:
I handled the email whitespace trim() problems in #3.
Still not sure what to do about the invalid emails in the list. I can fix them, but not sure what your long-term strategy is for keeping your static files and the remote list in sync.
I guess technically you could add the isemail module into package.json and do something like this where you only add the [trimmed] email address to the known-good list if it is actually an email address (and ignore everything that isn't email address-esque):
I have special eyes...
(Where the parenthesis'ed digits are approximate line numbers.)
And here's my magical linting code:
Note: You'll need to do a
npm i isemail -D
to install the isemail module.There are a few interesting results:
trim()
)Obviously, all easy to fix locally, but if you're [manually] scraping this from the remote blogspot site, it may be moot (unless you can get it changed upstream).
The text was updated successfully, but these errors were encountered: