Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/lib/scraper.js
2591 views
1
//═══════════════════════════════════════════════════════//
2
//If you want to recode, reupload
3
//or copy the codes/script,
4
//pls give credit
5
//no credit? i will take action immediately
6
//© 2022 Xeon Bot Inc. Cheems Bot MD
7
//Thank you to Lord Buddha, Family and Myself
8
//════════════════════════════//
9
const axios = require('axios')
10
const cheerio = require('cheerio')
11
12
13
function pinterest(querry){
14
return new Promise(async(resolve,reject) => {
15
axios.get('https://id.pinterest.com/search/pins/?autologin=true&q=' + querry, {
16
headers: {
17
"cookie" : "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0"
18
}
19
}).then(({ data }) => {
20
const $ = cheerio.load(data)
21
const result = [];
22
const hasil = [];
23
$('div > a').get().map(b => {
24
const link = $(b).find('img').attr('src')
25
result.push(link)
26
});
27
result.forEach(v => {
28
if(v == undefined) return
29
hasil.push(v.replace(/236/g,'736'))
30
})
31
hasil.shift();
32
resolve(hasil)
33
})
34
})
35
}
36
37
function wallpaper(title, page = '1') {
38
return new Promise((resolve, reject) => {
39
axios.get(`https://www.besthdwallpaper.com/search?CurrentPage=${page}&q=${title}`)
40
.then(({ data }) => {
41
let $ = cheerio.load(data)
42
let hasil = []
43
$('div.grid-item').each(function (a, b) {
44
hasil.push({
45
title: $(b).find('div.info > a > h3').text(),
46
type: $(b).find('div.info > a:nth-child(2)').text(),
47
source: 'https://www.besthdwallpaper.com/'+$(b).find('div > a:nth-child(3)').attr('href'),
48
image: [$(b).find('picture > img').attr('data-src') || $(b).find('picture > img').attr('src'), $(b).find('picture > source:nth-child(1)').attr('srcset'), $(b).find('picture > source:nth-child(2)').attr('srcset')]
49
})
50
})
51
resolve(hasil)
52
})
53
})
54
}
55
56
function wikimedia(title) {
57
return new Promise((resolve, reject) => {
58
axios.get(`https://commons.wikimedia.org/w/index.php?search=${title}&title=Special:MediaSearch&go=Go&type=image`)
59
.then((res) => {
60
let $ = cheerio.load(res.data)
61
let hasil = []
62
$('.sdms-search-results__list-wrapper > div > a').each(function (a, b) {
63
hasil.push({
64
title: $(b).find('img').attr('alt'),
65
source: $(b).attr('href'),
66
image: $(b).find('img').attr('data-src') || $(b).find('img').attr('src')
67
})
68
})
69
resolve(hasil)
70
})
71
})
72
}
73
74
function quotesAnime() {
75
return new Promise((resolve, reject) => {
76
const page = Math.floor(Math.random() * 184)
77
axios.get('https://otakotaku.com/quote/feed/'+page)
78
.then(({ data }) => {
79
const $ = cheerio.load(data)
80
const hasil = []
81
$('div.kotodama-list').each(function(l, h) {
82
hasil.push({
83
link: $(h).find('a').attr('href'),
84
gambar: $(h).find('img').attr('data-src'),
85
karakter: $(h).find('div.char-name').text().trim(),
86
anime: $(h).find('div.anime-title').text().trim(),
87
episode: $(h).find('div.meta').text(),
88
up_at: $(h).find('small.meta').text(),
89
quotes: $(h).find('div.quote').text().trim()
90
})
91
})
92
resolve(hasil)
93
}).catch(reject)
94
})
95
}
96
97
function aiovideodl(link) {
98
return new Promise((resolve, reject) => {
99
axios({
100
url: 'https://aiovideodl.ml/',
101
method: 'GET',
102
headers: {
103
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
104
"cookie": "PHPSESSID=69ce1f8034b1567b99297eee2396c308; _ga=GA1.2.1360894709.1632723147; _gid=GA1.2.1782417082.1635161653"
105
}
106
}).then((src) => {
107
let a = cheerio.load(src.data)
108
let token = a('#token').attr('value')
109
axios({
110
url: 'https://aiovideodl.ml/wp-json/aio-dl/video-data/',
111
method: 'POST',
112
headers: {
113
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
114
"cookie": "PHPSESSID=69ce1f8034b1567b99297eee2396c308; _ga=GA1.2.1360894709.1632723147; _gid=GA1.2.1782417082.1635161653"
115
},
116
data: new URLSearchParams(Object.entries({ 'url': link, 'token': token }))
117
}).then(({ data }) => {
118
resolve(data)
119
})
120
})
121
})
122
}
123
124
function umma(url) {
125
return new Promise((resolve, reject) => {
126
axios.get(url)
127
.then((res) => {
128
let $ = cheerio.load(res.data)
129
let image = []
130
$('#article-content > div').find('img').each(function (a, b) {
131
image.push($(b).attr('src'))
132
})
133
let hasil = {
134
title: $('#wrap > div.content-container.font-6-16 > h1').text().trim(),
135
author: {
136
name: $('#wrap > div.content-container.font-6-16 > div.content-top > div > div.user-ame.font-6-16.fw').text().trim(),
137
profilePic: $('#wrap > div.content-container.font-6-16 > div.content-top > div > div.profile-photo > img.photo').attr('src')
138
},
139
caption: $('#article-content > div > p').text().trim(),
140
media: $('#article-content > div > iframe').attr('src') ? [$('#article-content > div > iframe').attr('src')] : image,
141
type: $('#article-content > div > iframe').attr('src') ? 'video' : 'image',
142
like: $('#wrap > div.bottom-btns > div > button:nth-child(1) > div.text.font-6-12').text(),
143
}
144
resolve(hasil)
145
})
146
})
147
}
148
149
function ringtone(title) {
150
return new Promise((resolve, reject) => {
151
axios.get('https://meloboom.com/en/search/'+title)
152
.then((get) => {
153
let $ = cheerio.load(get.data)
154
let hasil = []
155
$('#__next > main > section > div.jsx-2244708474.container > div > div > div > div:nth-child(4) > div > div > div > ul > li').each(function (a, b) {
156
hasil.push({ title: $(b).find('h4').text(), source: 'https://meloboom.com/'+$(b).find('a').attr('href'), audio: $(b).find('audio').attr('src') })
157
})
158
resolve(hasil)
159
})
160
})
161
}
162
163
function styletext(teks) {
164
return new Promise((resolve, reject) => {
165
axios.get('http://qaz.wtf/u/convert.cgi?text='+teks)
166
.then(({ data }) => {
167
let $ = cheerio.load(data)
168
let hasil = []
169
$('table > tbody > tr').each(function (a, b) {
170
hasil.push({ name: $(b).find('td:nth-child(1) > span').text(), result: $(b).find('td:nth-child(2)').text().trim() })
171
})
172
resolve(hasil)
173
})
174
})
175
}
176
177
module.exports = { pinterest, wallpaper, wikimedia, quotesAnime, aiovideodl, umma, ringtone, styletext }
178
179