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

Function getGsScore

MoreSteamRatings/MoreSteamRatings.user.js:50–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50function getGsScore(){
51 getResult("http://www.gamespot.com/"+gameName, function(d){
52 let score=d.querySelector("span[itemprop=ratingValue]");
53 if(score){
54 /*let title=document.createElement("div");
55 title.onclick=function(){window.open("http://www.gamespot.com/"+gameName);};
56 title.style.cssText="color:#8f98a0;cursor: pointer;";
57 title.innerHTML="<div>Gamespot:</div>";
58 userReviews.parentNode.insertBefore(title,userReviews.nextSibling);
59 let scoreSpan=document.createElement("span");
60 scoreSpan.style.cssText="color:#A34C25;font-size:14px";
61 scoreSpan.innerHTML=score.innerHTML;
62 title.appendChild(scoreSpan);*/
63
64 let gameScore=metascore.cloneNode(true);
65 var gameBack=gameScore.querySelector("#game_area_metascore");
66 gameBack.style.backgroundImage="url(http://static1.gamespot.com/bundles/gamespotsite/images/logo-flat-midsize.png)";
67 gameBack.style.backgroundSize="141px";
68 gameBack.style.backgroundPosition="0 -10px";
69 let scoreValue=gameBack.querySelectorAll("span");
70 scoreValue[0].innerHTML=score.innerHTML;
71 scoreValue[2].innerHTML="10";
72 let scoreLink=gameScore.querySelector("#game_area_metalink>a");
73 scoreLink.href="http://www.gamespot.com/"+gameName;
74 scoreLink.innerHTML="Read Gamespot Reviews";
75 metascore.parentNode.appendChild(gameScore);
76 }
77 });
78}
79
80function getGrScore(){
81 getResult("http://www.gamerankings.com/browse.html?search="+encodeURI(appName.innerHTML)+"&site=pc&numrev=3", function(d){

Callers 1

Calls 1

getResultFunction · 0.85

Tested by

no test coverage detected