Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

feat: scrape more apkmirror versions #228

Merged
merged 1 commit into from
Aug 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions wsEvents/GetAppVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,52 +85,49 @@ module.exports = async function (message, ws) {
switch (global.jarNames.selectedApp) {
case 'youtube': {
versionsList = await getPage(
'https://www.apkmirror.com/apk/google-inc/youtube'
'https://www.apkmirror.com/uploads/?appcategory=youtube'
);
break;
}
case 'music': {
versionsList = await getPage(
'https://www.apkmirror.com/apk/google-inc/youtube-music'
'https://www.apkmirror.com/uploads/?appcategory=youtube-music'
);
break;
}
case 'android': {
versionsList = await getPage(
'https://www.apkmirror.com/apk/twitter/twitter'
'https://www.apkmirror.com/uploads/?appcategory=twitter'
);
break;
}
case 'frontpage': {
versionsList = await getPage(
'https://www.apkmirror.com/apk/redditinc/reddit'
'https://www.apkmirror.com/uploads/?appcategory=reddit'
);
break;
}
case 'warnapp': {
versionsList = await getPage(
'https://www.apkmirror.com/apk/deutscher-wetterdienst/warnwetter'
'https://www.apkmirror.com/uploads/?appcategory=warnwetter'
);
break;
}
}

const versionList = [];
let indx = 0;
const $ = load(versionsList);

for (const version of $(
'h5[class="appRowTitle wrapText marginZero block-on-mobile"]'
'#primary h5.appRowTitle.wrapText.marginZero.block-on-mobile'
).get()) {
if (indx === 10) continue;
const versionName = version.attribs.title
.replace('YouTube ', '')
.replace('Music ', '')
.replace('Twitter ', '')
.replace('Reddit ', '')
.replace('WarnWetter ', '');

indx++;
if (versionName.includes('beta')) continue;
else if (
global.jarNames.selectedApp === 'android' &&
Expand Down