-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfake.js
67 lines (57 loc) · 1.72 KB
/
fake.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const axios = require('axios');
const cheerio = require('cheerio')
const fs = require('fs');
const instance = axios.create({
headers: {'Referer' : 'http://www.4devs.com.br/gerador_conta_bancaria'}
});
const getBanco = axios.get('http://www.4devs.com.br/gerador_conta_bancaria')
.then(function (response) {
const $ = cheerio.load(response.data);
const str = $('script').text();
const re = /token_calc\s*\=\s*\"(.*)\"\s*;/;
let m;
let cc = '1';
let ag = '1';
if ((m = re.exec(str)) !== null) {
const token = m[1];
return instance.post('http://www.4devs.com.br/ferramentas_online.php', 'token='+token+'&acao=gerar_conta_bancaria&estado=&banco=151')
.then(function (response) {
const $2 = cheerio.load(response.data);
cc = $2('#conta_corrente').val();
ag = $2('#agencia').val();
return {cc, ag};
}).catch(function (err) {
console.log(err);
return {cc,ag}
})
}
return {cc,ag}
})
.catch(function (error) {
// console.log(error);
});
const getCPF = axios.get('https://www.geradordecpf.org/gerarcpf?pontuacao=0')
.then(function (response) {
// return response.data;
return response.data.toString();
})
.catch(function (error) {
// console.log(error);
});
// const getEmail = Promise.resolve('zmqsfptf@zetmail.com');
const getEmail = axios.get('http://getairmail.com/random')
.then(function (response) {
const $ = cheerio.load(response.data);
const email = $('#tempemail').val();
return email;
})
.catch(function (error) {
// console.log(error);
});
module.exports = {
getFakeData: function functionName() {
return Promise.all([getCPF,getBanco, getEmail]).then(([cpf,{cc, ag}, email]) => {
return {cpf, cc, ag, email}
});
}
};