-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
94 lines (73 loc) · 3.06 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
// -- Scripped -- //
var errortext = "An error occurred.";
console.log();
console.log("ROBLOX Game Rating.");
console.log("This was built by Scripped.");
console.log();
console.log("Contact:");
console.log();
console.log("GitHub: https://github.com/Scripped.");
console.log("Roblox: https://www.roblox.com/users/1957038621/profile.");
console.log();
const prompt = require('prompt-sync')({sigint: true});
var gameid = prompt('Enter a game ID (Right click to paste):');
const puppeteer = require('puppeteer');
const $ = require('cheerio');
const url = "https://www.roblox.com/games/"+ gameid +"/";
const open = require('open');
puppeteer
.launch()
.then(function(browser) {
return browser.newPage();
})
.then(function(page) {
return page.goto(url).then(function() {
return page.content();
});
})
.then(function(html) {
$('.game-name', html).each(function() {
console.log("Game Name: " + $(this).text());
})
$('.game-creator > .text-name', html).each(function() {
console.log("Game Creator: " + $(this).text());
})
$('#vote-up-text', html).each(function() {
console.log( "Likes: " + $(this).text());
})
$('#vote-down-text', html).each(function() {
console.log( "Dislikes: " + $(this).text());
var gameoption = prompt("Would you like to join the game? (Y/N)");
if (gameoption === "N" || gameoption === "no" || gameoption === "No" || gameoption === "NO" || gameoption === "n") {
console.log();
console.log("Alright.");
console.log("Click CTRL + C to quit since there isn't really anything else to do on this.");
console.log("If you're still reading, pls follow me on roblox: ");
console.log("https://www.roblox.com/users/1957038621/profile");
console.log()
var follow = prompt("Should I open the link for you? (Y/N)");
if (follow === "N" || follow === "no" || follow === "No" || follow === "NO" || follow === "n") {
console.log();
console.log("Okay, then lol bye.");
process.exit(1);
}
else if (follow === "y" || follow === "Y" || follow === "Yes" || follow === "yes" || follow === "YES") {
open('https://www.roblox.com/users/1957038621/profile');
}
else {
open('https://www.roblox.com/users/1957038621/profile');
}
}
else if (gameoption === "y" || gameoption === "Y" || gameoption === "Yes" || gameoption === "yes" || gameoption === "YES") {
open(url)
}
else {
process.exit(1);
}
})
})
.catch(function(err) {
console.log(errortext);
process.exit(1);
})
console.log('TIP: Click CTRL + C to quit.')