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

Commit

Permalink
Merge pull request #228 from j4k0xb/main
Browse files Browse the repository at this point in the history
feat: scrape more apkmirror versions
  • Loading branch information
reis authored Aug 14, 2022
2 parents 219b977 + 4d1a3b0 commit c1d2545
Showing 1 changed file with 6 additions and 9 deletions.
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

0 comments on commit c1d2545

Please sign in to comment.