filter with date ; working backend and frontend

This commit is contained in:
GotPPay
2017-12-11 18:22:06 +01:00
parent b634bfd300
commit 6859ba39be
26 changed files with 128932 additions and 12 deletions

View File

@@ -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]});
}
}
});