-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
77 lines (59 loc) · 2.59 KB
/
index.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
const $ = require('cheerio');
const puppeteer = require('puppeteer');
const prompt = require('prompt-sync')({sigint: true});
const opn = require('opn');
console.log()
console.log('█▀█ █▀█ █▄▄ █░░ █▀█ ▀▄▀ █ █▄░█ █░█ █▀▀ █▄░█ ▀█▀ █▀█ █▀█ █▄█ █▀ █░█ █▀█ █▀█ █▀█ █▀▀ █▀█')
console.log('█▀▄ █▄█ █▄█ █▄▄ █▄█ █░█ █ █░▀█ ▀▄▀ ██▄ █░▀█ ░█░ █▄█ █▀▄ ░█░ ▄█ █▀█ █▄█ █▀▀ █▀▀ ██▄ █▀▄')
console.log()
console.log()
console.log('Contact:')
console.log()
console.log('Github: http://github.com/Scripped')
console.log('Roblox: https://www.roblox.com/users/1957038621/profile')
console.log()
prompt('Press any key to continue: ');
// clear the console //
process.stdout.write('\033c');
console.log('Right click to paste.')
const userid = prompt('Enter the user ID (NOT the username): ')
const url = "https://www.roblox.com/users/"+ userid +"/profile";
const incognito = prompt('Would you like these links to open on incognito mode? (no) ')
if (incognito == 'yes' || incognito === 'y' || incognito === 'Yes' || incognito === 'YES' || incognito === 'Y') {
function opencommand() { opn(itemurl, {app: ['chrome', '--incognito']});}
} else {
function opencommand() { opn(itemurl);}
}
console.log('Ctrl + C to quit when you have finished reading.')
console.log()
scrape()
async function scrape() {
const browser = await puppeteer.launch({executablePath: "./node_modules/puppeteer/.local-chromium/win64-869685/chrome-win/chrome.exe"})
.then(async function(browser) {
return browser.newPage()
})
.then(async function(page) {
return page.goto(url).then(function() {
return page.content()
})
})
.then(function(html) {
$('h2.profile-name', html).each(function() {
console.log( 'Username: ' + $(this).text())
})
$('.accoutrement-item > a', html).each(function() {
itemurl = $(this).attr('href');
console.log( 'Currently Wearing: ' + itemurl)
const openoption = prompt('Want to open this link? (yes) ')
if (openoption === 'no' || openoption === 'n' || openoption === 'No' || openoption === 'NO' || openoption === 'N') {
console.log()
}
else {
opencommand()
}
})
})
.catch(function(err) {
console.log('An error occured. Ctrl + C to quit. ' + err )
})
}