GithubHelp home page GithubHelp logo

gm_scripts's People

Contributors

zhifengle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gm_scripts's Issues

评分对比助手 is a great script, but some bugs need fixing

First of all, thank you for your 评分对比助手 script, it's great. Unfortunately, it has some problems.

The extraction of the VNDB score appears to be broken. But it can be fixed by replacing const s = vote.match(/average (\d+(\.\d+))/); with const s = vote.match(/(\d+(\.\d+)?)(?= average)/);

Additionally, the search logic requires enhancement as it is currently unable to retrieve game pages on EGS and VNDB when there are discrepancies such as between = and =, 2 and 2, Ⅲ and III, - and -, etc. I managed to slightly improve results by modifying normalizeQuery function:

      let newQuery = query
          .replace(/([^~]*~[^~]*~[^~]*)/g, function(match) { return match.replace(/~|~/g, ' '); })
          .replace(/=|=/g, ' ')
          .replace(/0/g, '0')
          .replace(/1/g, '1')
          .replace(/2/g, '2')
          .replace(/3/g, '3')
          .replace(/4/g, '4')
          .replace(/5/g, '5')
          .replace(/6/g, '6')
          .replace(/7/g, '7')
          .replace(/8/g, '8')
          .replace(/9/g, '9')
          .replace(/Ⅰ/g, 'I')
          .replace(/Ⅱ/g, 'II')
          .replace(/Ⅲ/g, 'III')
          .replace(/Ⅳ/g, 'IV')
          .replace(/Ⅴ/g, 'V')
          .replace(/Ⅵ/g, 'VI')
          .replace(/Ⅶ/g, 'VII')
          .replace(/Ⅷ/g, 'VIII')
          .replace(/Ⅸ/g, 'IX')
          .replace(/Ⅹ/g, 'X')
          .replace(/-|-/g, ' ')
          .replace(/\s{2,}/g, ' ')
          .replace(/~/g, '~')

          .trim();
      return newQuery;
  }

In addition to this, sometimes when fetching scores for some visual novels from EGS, the script fetches them from a random port of said visual novel that has a significantly smaller number of votes. The expected behavior should be either to fetch the score from the entry with the most number of votes or not to fetch scores automatically at all and prompt a user to press ‘Click to search’ instead.

See: https://vndb.org/v7302
https://vndb.org/v18498
https://vndb.org/v22783
https://vndb.org/v15473
https://vndb.org/v751
https://vndb.org/v57
https://vndb.org/v12849
https://vndb.org/v5154
https://vndb.org/v19684
https://vndb.org/v20424
https://vndb.org/v13666
https://vndb.org/v17
https://vndb.org/v7723
https://vndb.org/v29444

Another problem I encountered is also with fetching scores from EGS. It keeps fetching the **値 even when score: (_b = (_a = $q('#average > td')) === null || _a === void 0 ? void 0 : _a.textContent.trim()) !== null && _b !== void 0 ? _b : 0, is set.

Upon further investigation, it seems the script fetches a score number from the search page instead of the game page, and the search page only has the **値 value. When a user opens the game page on their own, the score number on other sites successfully updates to the average value. So, as I see it, the problem is that the score fetching is happening in the getSearchItem$1 function instead of the getSearchResult$1 function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.