MCPcopy Create free account
hub / github.com/hoothin/UserScripts / getMcScore

Function getMcScore

MoreSteamRatings/MoreSteamRatings.user.js:33–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33function getMcScore(){
34 getResult("http://www.metacritic.com/game/pc/"+gameName, function(d){
35 let score=d.querySelector("span[itemprop=ratingValue]");
36 if(score){
37 let title=document.createElement("div");
38 title.onclick=function(){window.open("http://www.metacritic.com/game/pc/"+gameName);};
39 title.style.cssText="color:#8f98a0;cursor: pointer;";
40 title.innerHTML="<div>Metacritic:</div>";
41 userReviews.parentNode.insertBefore(title,userReviews.nextSibling);
42 let scoreSpan=document.createElement("span");
43 scoreSpan.style.cssText="color:#A34C25;font-size:14px";
44 scoreSpan.innerHTML=score.innerHTML;
45 title.appendChild(scoreSpan);
46 }
47 });
48}
49
50function getGsScore(){
51 getResult("http://www.gamespot.com/"+gameName, function(d){

Callers

nothing calls this directly

Calls 1

getResultFunction · 0.85

Tested by

no test coverage detected