-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
379 lines (311 loc) · 14 KB
/
app.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
#! /usr/bin/env node
import fetch from 'node-fetch';
import fs from 'fs'
import colors from 'colors'
import PromptSync from 'prompt-sync'
import nodeBashTitle from 'node-bash-title';
import yargs from 'yargs';
const prompt = PromptSync();
const usage = "\nUsage: view <username/ID>";
var argv = yargs(process.argv.slice(2))
.usage(usage)
.help(true)
.argv;
function log(txt) {
console.log('[X] '.brightRed + txt)
}
function error(txt) {
console.log('[!] '.brightRed + txt.toUpperCase())
}
function pprompt(txt) {
return prompt('[X] '.brightRed + '>> ' + txt.toUpperCase().brightWhite);
}
function showErr() {
error('An error occurred')
pprompt('Press any key to quit')
return process.exit(1)
}
var base = {}
var info = []
async function f(url, res, txt, num) {
var response = await fetch(url);
var data = await response.json();
var dataAr = Array.of(data);
var re = res.split(',');
var txt = txt.split(',')
for (let i = 0; i < dataAr.length; i++) {
info[num] += '\n\n'
for (let n = 0; n < re.length; n++) {
const el = re[n];
console.log(txt[n].brightRed + ': '+ dataAr[i][el])
info[num] += txt[n] + ': '+ dataAr[i][el] + '\n'
}
}
}
async function fd(url, res, txt, num) {
var response = await fetch(url);
var data = await response.json();
var dataAr = data.data;
var re = res.split(',');
var txt = txt.split(',')
for (let i = 0; i < dataAr.length; i++) {
info[num] += '\n\n'
for (let n = 0; n < re.length; n++) {
const el = re[n];
//return '[' + (parseInt(i)+1) + '] ' + txt[n].brightRed + ': '+ dataAr[i][el]
console.log('[' + (parseInt(i)+1) + '] ' + txt[n].brightRed + ': '+ dataAr[i][el])
info[num] += '[' + (parseInt(i)+1) + '] ' + txt[n] + ': '+ dataAr[i][el] + '\n';
}
console.log()
}
}
async function fb(url, res, txt, num) {
var response = await fetch(url);
var data = await response.json();
var dataAr = data;
var re = res.split(',');
var txt = txt.split(',')
for (let i = 0; i < dataAr.length; i++) {
info[num] += '\n\n'
for (let n = 0; n < re.length; n++) {
const el = re[n];
console.log(txt[n].brightRed + ': '+ dataAr[i][el])
info[num] += txt[n] + ': '+ dataAr[i][el] + '\n'
}
}
}
async function fgroup(url, num) {
var response = await fetch(url);
var data = await response.json();
var dataAr = data.data;
info[num] += '\n\n'
dataAr.forEach(ar => {
console.log(ar)
info[num] += JSON.stringify(ar) + '\n';
});
}
async function c(url, text, num) {
var response = await fetch(url);
var data = await response.json();
console.log(text.brightRed + data.count)
info[num] += '\n\n'
info[num] += text + data.count + '\n'
}
function start() {
nodeBashTitle('BANVIEW BY SCR1PP3D')
console.clear();
console.log(`
██████╗░░█████╗░███╗░░██╗██╗░░░██╗██╗███████╗░██╗░░░░░░░██╗
██╔══██╗██╔══██╗████╗░██║██║░░░██║██║██╔════╝░██║░░██╗░░██║
██████╦╝███████║██╔██╗██║╚██╗░██╔╝██║█████╗░░░╚██╗████╗██╔╝
██╔══██╗██╔══██║██║╚████║░╚████╔╝░██║██╔══╝░░░░████╔═████║░
██████╦╝██║░░██║██║░╚███║░░╚██╔╝░░██║███████╗░░╚██╔╝░╚██╔╝░
╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░BANNED USER VIEWER
BY SCR1PP3D
─────────────────────────────────────────────────`.brightRed)
}
async function getID() {
start()
var arg = argv._.toString()
if (parseInt(arg)) {
function checkNum() {
log('You entered a number, is this a URL (u) or an ID (i): ')
var type = pprompt('');
if (type.toLowerCase() == 'u') {
getIDFromUsername()
}
else if (type.toLowerCase() == 'i') {
base.id = arg
checkMethod()
}
else {
checkNum()
}
}
checkNum()
}
else if (typeof arg == 'string' && !arg.includes('=')) {
getIDFromUsername()
}
else {
process.exit(1)
}
async function getIDFromUsername() {
var url = 'https://api.roblox.com/users/get-by-username?username='+arg;
var response = await fetch(url);
var data = await response.json();
var id = data.Id;
base.id = id
if (JSON.stringify(data).includes('Something went wrong')) {
return showErr()
}
checkMethod()
}
}
async function checkMethod() {
start()
log('ID: '+ base.id)
console.log(`
[1] Basic User Info (Display Name, Join Date)
[2] Favorite Games
[3] Game Badges
[4] Roblox Badges
[5] Groups they were in
[6] Friends
[7] Friends, Followings and Followers Count
[8] Roblox avatar (face only)
[9] Save all to .txt file
[10] Display everything about the user
[11] Exit
`)
var opt = pprompt('')
if (opt=='1') {
console.clear();
await f('https://users.roblox.com/v1/users/'+ base.id, 'displayName,description,created', 'Display Name,About Me,Join Date', 1)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='2') {
console.clear();
await fd('https://games.roblox.com/v2/users/'+ base.id + '/favorite/games?sortOrder=Asc&limit=10', 'id,name', 'Game ID,Game Name', 2)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='3') {
console.clear();
await fd('https://badges.roblox.com/v1/users/'+base.id+'/badges?limit=10&sortOrder=Asc', 'id,name,description', 'Badge ID,Badge Name,Badge Description',3)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='4') {
console.clear();
await fb('https://accountinformation.roblox.com/v1/users/'+base.id+'/roblox-badges', 'name,description', 'Badge Name,Badge Description',4)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='5') {
console.clear();
await fgroup('https://groups.roblox.com/v2/users/'+base.id+'/groups/roles',5)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='6') {
console.clear();
await fd('https://friends.roblox.com/v1/users/'+base.id+'/friends?limit=10', 'id,isOnline,name,displayName', 'User ID,Is Online,Name,Display Name',6)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='7') {
console.clear();
await c('https://friends.roblox.com/v1/users/'+base.id+'/friends/count', 'Friends: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followers/count', 'Followers: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followings/count', 'Following: ',7)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='8') {
console.clear();
await fd('https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds='+base.id+'&size=150x150&format=Png&isCircular=false', 'imageUrl', 'Headshot',8)
pprompt('Press any key to continue')
checkMethod()
}
else if (opt=='9') {
console.clear();
var url = 'https://users.roblox.com/v1/users/'+ base.id;
var response = await fetch(url);
var data = await response.json();
var p = data.name
fs.mkdirSync(p, { recursive: true })
await f('https://users.roblox.com/v1/users/'+ base.id, 'displayName,description,created', 'Display Name,About Me,Join Date', 1)
await fd('https://games.roblox.com/v2/users/'+ base.id + '/favorite/games?sortOrder=Asc&limit=10', 'id,name', 'Game ID,Game Name', 2)
await fd('https://badges.roblox.com/v1/users/'+base.id+'/badges?limit=10&sortOrder=Asc', 'id,name,description', 'Badge ID,Badge Name,Badge Description',3)
await fb('https://accountinformation.roblox.com/v1/users/'+base.id+'/roblox-badges', 'name,description', 'Badge Name,Badge Description',4)
await fgroup('https://groups.roblox.com/v2/users/'+base.id+'/groups/roles',5)
await fd('https://friends.roblox.com/v1/users/'+base.id+'/friends?limit=10', 'id,isOnline,name,displayName', 'User ID,Is Online,Name,Display Name',6)
await fd('https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds='+base.id+'&size=150x150&format=Png&isCircular=false', 'imageUrl', 'Headshot',8)
await c('https://friends.roblox.com/v1/users/'+base.id+'/friends/count', 'Friends: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followers/count', 'Followers: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followings/count', 'Following: ',7)
console.clear();
fs.writeFile(p+'/Basic_User_Info.txt', info[1], function (err) {
if (err) console.log(err);
});
fs.writeFile(p+'/Favorite_Games.txt',info[2], function (err) {
if (err) throw err;
});
fs.writeFile(p+'/Game_Badges.txt',info[3], function (err) {
if (err) throw err;
});
fs.writeFile(p+'/Roblox_Badges.txt',info[4], function (err) {
if (err) throw err;
});
fs.writeFile(p+'/Groups.txt',info[5], function (err) {
if (err) throw err;
});
fs.writeFile(p+'/Friends.txt',info[6], function (err) {
if (err) throw err;
});
fs.writeFile(p+'/Friends_Following_Followers_Count.txt',info[7], function (err) {
if (err) throw err;
});
console.clear();
console.log('DONE!')
}
else if (opt=='10') {
getInfo()
}
else if (opt=='11') {
process.exit()
}
else {
checkMethod()
}
}
async function getInfo() {
var urls = {
1: 'https://users.roblox.com/v1/users/'+ base.id,
2: 'https://games.roblox.com/v2/users/'+ base.id + '/favorite/games?sortOrder=Asc&limit=10',
3: 'https://badges.roblox.com/v1/users/'+base.id+'/badges?limit=10&sortOrder=Asc',
4: 'https://accountinformation.roblox.com/v1/users/'+base.id+'/roblox-badges',
5: 'https://games.roblox.com/v2/users/'+base.id+'/games?sortOrder=Asc&limit=10',
6: 'https://groups.roblox.com/v2/users/'+base.id+'/groups/roles',
7: 'https://friends.roblox.com/v1/users/'+base.id+'/friends?limit=10',
8: 'https://friends.roblox.com/v1/users/'+base.id+'/friends/count',
9: 'https://friends.roblox.com/v1/users/'+base.id+'/followings/count',
10: 'https://friends.roblox.com/v1/users/'+base.id+'/followers/count',
11: 'https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds='+base.id+'&size=48x48&format=Png&isCircular=false'
}
console.log()
console.log()
console.log('USER INFO:'.brightWhite)
await f('https://users.roblox.com/v1/users/'+ base.id, 'displayName,description,created', 'Display Name,About Me,Join Date', 1)
console.log()
console.log('FAVORITE GAMES:'.brightWhite)
await fd('https://games.roblox.com/v2/users/'+ base.id + '/favorite/games?sortOrder=Asc&limit=10', 'id,name', 'Game ID,Game Name', 2)
console.log()
console.log('BADGES:'.brightWhite)
await fd('https://badges.roblox.com/v1/users/'+base.id+'/badges?limit=10&sortOrder=Asc', 'id,name,description', 'Badge ID,Badge Name,Badge Description',3)
console.log()
console.log('ROBLOX BADGES')
await fb('https://accountinformation.roblox.com/v1/users/'+base.id+'/roblox-badges', 'name,description', 'Badge Name,Badge Description',4)
console.log()
console.log('GROUP ROLES')
await fgroup('https://groups.roblox.com/v2/users/'+base.id+'/groups/roles',5)
console.log()
console.log('FRIENDS')
await fd('https://friends.roblox.com/v1/users/'+base.id+'/friends?limit=200', 'id,isOnline,name,displayName', 'User ID,Is Online,Name,Display Name',6)
console.log()
console.log('FRIENDS/FOLLOWERS/FOLLOWINGS COUNT')
await c('https://friends.roblox.com/v1/users/'+base.id+'/friends/count', 'Friends: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followers/count', 'Followers: ',7)
await c('https://friends.roblox.com/v1/users/'+base.id+'/followings/count', 'Following: ',7)
console.log()
console.log('ROBLOX AVATAR')
await fd('https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds='+base.id+'&size=150x150&format=Png&isCircular=false', 'imageUrl', 'Headshot',8)
/* group icons
'https://thumbnails.roblox.com/v1/groups/icons?groupIds='12325228'&size=150x150&format=Png&isCircular=false'
*/
pprompt('Press any key to continue')
checkMethod()
}
getID()