-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor code optimizations, export options
- Loading branch information
eduardomota
committed
Jan 28, 2019
1 parent
6179a3d
commit 83332ea
Showing
55 changed files
with
1,493 additions
and
2,937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
Object resetter helper function | ||
*/ | ||
|
||
|
||
const defaultValue = {}; // default clean object | ||
|
||
// Resets object to input parameter object | ||
function resetObj(defaultObject = defaultValue) { | ||
return JSON.parse(JSON.stringify(defaultObject));; | ||
} | ||
|
||
module.exports = { | ||
resetObj: resetObj, | ||
resetObject: resetObj // extended function alias | ||
} |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const electron = require('electron'), | ||
path = require('path'), | ||
conversions = require('../../common/conversions.js'); | ||
|
||
var { | ||
appSettings | ||
} = require('../../appsettings.js'); | ||
|
||
const { | ||
app, | ||
BrowserWindow, | ||
Menu, | ||
ipcMain, | ||
dialog, | ||
remote | ||
} = electron; | ||
|
||
ipcMain.on('bulkwhois:export', function(event, options) { | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const electron = require('electron'), | ||
debug = require('debug')('main.bulkwhois.fileinput'); | ||
|
||
const { | ||
app, | ||
BrowserWindow, | ||
Menu, | ||
ipcMain, | ||
dialog, | ||
remote | ||
} = electron; | ||
|
||
// Bulk domain, file input path | ||
ipcMain.on('bulkwhois:input.file', function(event) { | ||
debug("Waiting for file selection"); | ||
var filePath = dialog.showOpenDialog({ | ||
title: "Select wordlist file", | ||
buttonLabel: "Open", | ||
properties: ['openFile', 'showHiddenFiles'] | ||
}); | ||
debug("Using selected file at {0}".format(filePath)); | ||
event.sender.send('bulkwhois:fileinput.confirmation', filePath); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
var defaultFirstValue = null, // Default that is equivalent or similar to null value: null, undefined, false.. | ||
defaultSecondValue = 0, // Default numeric starting value | ||
defaultThirdValue = '-'; // Default value other than null or numeric start | ||
|
||
|
||
// Default BulkWhois values | ||
module.exports = { | ||
'input': { | ||
'domains': [], | ||
'domainsPending': [], | ||
'tlds': [] | ||
}, | ||
'stats': { | ||
'domains': { | ||
'processed': defaultSecondValue, | ||
'sent': defaultSecondValue, | ||
'waiting': defaultSecondValue, | ||
'total': defaultSecondValue | ||
}, | ||
'time': { | ||
'current': defaultFirstValue, | ||
'remaining': defaultFirstValue, | ||
'counter': defaultFirstValue, | ||
'currentcounter': defaultSecondValue, | ||
'remainingcounter': defaultSecondValue | ||
}, | ||
'reqtimes': { | ||
'minimum': defaultFirstValue, | ||
'average': defaultFirstValue, | ||
'maximum': defaultFirstValue, | ||
'last': defaultFirstValue | ||
}, | ||
'status': { | ||
'available': defaultSecondValue, | ||
'unavailable': defaultSecondValue, | ||
'error': defaultSecondValue, | ||
'percentavailable': defaultFirstValue, | ||
'percentunavailable': defaultFirstValue, | ||
'percenterror': defaultFirstValue | ||
}, | ||
'laststatus': { | ||
'available': defaultFirstValue, | ||
'unavailable': defaultFirstValue, | ||
'error': defaultFirstValue | ||
} | ||
}, | ||
'results': { | ||
'id': [], | ||
'domain': [], | ||
'status': [], | ||
'registrar': [], | ||
'company': [], | ||
'updatedate': [], | ||
'creationdate': [], | ||
'expirydate': [], | ||
'whoisreply': [], | ||
'whoisjson': [], | ||
'requesttime': [] | ||
}, | ||
'processingIDs': [], | ||
'domains': [], | ||
'default': { | ||
'numericstart': defaultFirstValue, | ||
'others': defaultThirdValue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const electron = require('electron'), | ||
debug = require('debug')('main.bulkwhois.wordlistinput'); | ||
|
||
const { | ||
app, | ||
BrowserWindow, | ||
Menu, | ||
ipcMain, | ||
dialog, | ||
remote | ||
} = electron; | ||
|
||
// Bulk domain, wordlist input | ||
ipcMain.on('bulkwhois:input.wordlist', function(event) { | ||
debug("Using wordlist input"); | ||
event.sender.send('bulkwhois:wordlistinput.confirmation'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
var whois = require('../common/whoiswrapper.js'); | ||
var conversions = require('../common/conversions.js'); | ||
|
||
require('../common/stringformat.js'); | ||
|
||
require('./bulkwhois/wordlistinput.js'); | ||
require('./bulkwhois/fileinput.js'); | ||
require('./bulkwhois/process.js'); | ||
require('./bulkwhois/export.js'); | ||
|
||
const { | ||
ipcRenderer | ||
} = require('electron'); | ||
|
||
// Prevent drag over redirect | ||
document.addEventListener('dragover', function(event) { | ||
event.preventDefault(); | ||
return false; | ||
}, false); | ||
/* Bulk whois handling */ | ||
require('./bulkwhois/wordlistinput.js'); // Bulk whois by wordlist input | ||
require('./bulkwhois/fileinput.js'); // Bulk whois by file input | ||
require('./bulkwhois/process.js'); // Bulk whois requests processing | ||
require('./bulkwhois/export.js'); // Export processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Default export options values | ||
module.exports = { | ||
'filetype': 'csv', // Filetype to export | ||
'domains': 'available', // Export only available domains | ||
'errors': 'no', // Do not export lookup errors | ||
'information': 'domain', // Export only domain name | ||
'whoisreply': 'no' // Do not include whois replies in export | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.