Skip to content

Commit

Permalink
EEP
Browse files Browse the repository at this point in the history
  • Loading branch information
I2rys committed Jan 11, 2022
0 parents commit 4bfc9de
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2022 I2rys

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<h1 align="center">EEP</h1>
<h4 align="center">File email:password filter and duplicate remover</h4>
<p align="center">
<a href="https://github.com/I2rys/EEP/blob/main/LICENSE"><img src="https://img.shields.io/github/license/I2rys/EEP?style=flat-square"></img></a>
<a href="https://github.com/I2rys/EEP/issues"><img src="https://img.shields.io/github/issues/I2rys/EEP.svg"></img></a>
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/-Nodejs-green?style=flat-square&logo=Node.js"></img></a>
</p>


## Installation
Github:

git clone https://github.com/I2rys/EEP

## Usage

node index.js <input> <output>

+ input - The path of the file to get email:pass, filter and rewrite It's content.
+ output - The output of the accounts.

## License
MIT © I2rys
49 changes: 49 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//Dependencies
const Fs = require("fs")

//Variables
const Self_Args = process.argv.slice(2)

var accounts = []

//Main
if(!Self_Args.length){
console.log("node index.js <input> <output>")
process.exit()
}

if(!Fs.existsSync(Self_Args[0])){
console.log("Unable to find the file.")
process.exit()
}

if(!Self_Args[1]){
console.log("Invalid output.")
process.exit()
}

const file_data = Fs.readFileSync(Self_Args[0], "utf8")

if(!file_data.length){
console.log("File data is empty.")
process.exit()
}

console.log("Grabbing accounts.")
const accounts_found = file_data.match(/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9.-]+:[a-zA-Z0-9._-]+/g)

if(!accounts_found){
console.log("No accounts found.")
process.exit()
}

console.log("Filtering accounts.")
for( i in accounts_found ){
if(accounts.indexOf(accounts_found[i]) == -1){
accounts.push(accounts_found[i])
}
}

console.log(`Saving accounts to ${Self_Args[1]}.`)
Fs.writeFileSync(Self_Args[1], accounts.join("\n"), "utf8")
console.log(`Accounts successfully saved in ${Self_Args[1]}`)

0 comments on commit 4bfc9de

Please sign in to comment.