Skip to content

Commit

Permalink
Merge pull request #1 from billboardss/fractional-rating
Browse files Browse the repository at this point in the history
Fractional rating
  • Loading branch information
twentytwo777 authored Oct 12, 2024
2 parents 89f0f27 + 9bb7b1c commit 363f3c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/API/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class FunPayProfile {
const getProfile = await axios.get(`${APIFunPayUrls.GET_PROFILE}${littleInfo.id}/`);
const profileData = getProfile.data;

const hasRating = profileData.match(/<span class="big">(.*)<\/span>/g);
const rating = hasRating ? +hasRating[0].match(/>(.*)</)[1][0] : 0;
const hasRating = profileData.match(/<span class="big">(.*)<\/span>/g)[0].match(/>(.*)</)[1];
const rating = parseFloat(hasRating) ? parseFloat(hasRating) : 0;

const hasReviews = profileData.match(/<div class="text-mini text-light mb5">(.*)<\/div>/g);
const totalReviews = hasReviews ? +hasReviews[0].match(/>(.*?)</)[1].match(/\d+/)[0] : 0;
Expand Down

0 comments on commit 363f3c6

Please sign in to comment.