zhifengle / gm_scripts Goto Github PK
View Code? Open in Web Editor NEWUserScripts
UserScripts
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.