filter with date ; working backend and frontend
This commit is contained in:
@@ -5,18 +5,20 @@ var fs = require('fs');
|
||||
|
||||
module.exports = {
|
||||
getDomainList : function(url, callback){
|
||||
|
||||
getRawDomainList(url,(raw)=>{
|
||||
|
||||
let result = [];
|
||||
raw.split('\n').map(domain=>{
|
||||
let unicodeDomain = punycode.toUnicode(domain);
|
||||
let dot = unicodeDomain.indexOf('.');
|
||||
let tab = unicodeDomain.indexOf('\t');
|
||||
if (dot !== -1){
|
||||
let domainName = unicodeDomain.substring(0,dot);
|
||||
let tld = unicodeDomain.substring(dot+1,tab);
|
||||
if (domainName.match(config.swedishLettersOnly)){
|
||||
//domain name contains only letters
|
||||
//line in domain list is formatted as follows : [domain name]\t[expiration date]
|
||||
result.push({domainName: domainName, expirationDate: domain.split('\t')[1]});
|
||||
result.push({domainName: domainName, tld:tld ,expirationDate: domain.split('\t')[1]});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user