Greasy Fork镜像 还支持 简体中文。

MetaCriticAll

Metacritic ratings everywhere. See the supported sites in the @include section of the script.

目前為 2014-06-30 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name MetaCriticAll
  3. // @namespace http://stackoverflow.com/users/982924/rasg
  4. // @author RASG
  5. // @version 2014.06.30
  6. // @description Metacritic ratings everywhere. See the supported sites in the @include section of the script.
  7. // @icon http://www.metacritic.com/favicon.ico
  8. // @require http://code.jquery.com/jquery.min.js
  9. // @resource metacritic.global.css http://ufpr.dl.sourceforge.net/project/userscripts/metacriticall/metacritic.global.css
  10. // @resource metacritic.base.css http://ufpr.dl.sourceforge.net/project/userscripts/metacriticall/metacritic.base.css
  11. // @resource metacritic.css http://ufpr.dl.sourceforge.net/project/userscripts/metacriticall/metacritic.css
  12. // @grant GM_addStyle
  13. // @grant GM_getResourceText
  14. // @grant GM_log
  15. // @grant GM_xmlhttpRequest
  16. // @include http*://*.getgamesgo.com/*
  17. // @include http*://*.greenmangaming.com/*/games/*
  18. // @include http*://*isthereanydeal.com/*
  19. // @include http*://*.nuuvem.com.br/produto*
  20. // @include http*://*steamcommunity.com/id/*/wishlist
  21. // @include http*://*.steamgifts.com/*
  22. // @include http*://*store.steampowered.com/*
  23. // ==/UserScript==
  24.  
  25.  
  26. var estilo1 = GM_getResourceText ("metacritic.global.css");
  27. GM_addStyle (estilo1);
  28. var estilo2 = GM_getResourceText ("metacritic.base.css");
  29. GM_addStyle (estilo2);
  30. var estilo3 = GM_getResourceText ("metacritic.css");
  31. GM_addStyle (estilo3);
  32.  
  33.  
  34. $(function(){
  35.  
  36. // SEARCHING FOR GAMES
  37. if (window.location.href.indexOf('getgamesgo.com/product/') > -1) {
  38. full_ou_mini = 'full';
  39. elementos = $('#pageTitle');
  40. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  41. $('nav.mainTitle').removeClass('mainTitle').css({"border":"2px solid rgb(66, 127, 166)", "background":"none repeat scroll 0% 0% rgb(0, 0, 0)"});
  42. }
  43.  
  44. if (window.location.href.indexOf('greenmangaming.com/s') > -1) {
  45. full_ou_mini = 'full';
  46. elementos = $('div#main > .prod_det');
  47. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  48. $("<style>.metafull { display: table !important; }</style>").appendTo(document.documentElement);
  49. $("div.wrapper").css({"min-width":"70%", "max-width":"90%"});
  50. }
  51.  
  52. if (window.location.href.indexOf('isthereanydeal.com') > -1) {
  53. full_ou_mini = 'mini';
  54. elementos = $('div.title');
  55. elementos.css({'border':'1px solid red'})
  56. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  57. }
  58.  
  59. if (window.location.href.indexOf('nuuvem.com.br/produto/') > -1) {
  60. full_ou_mini = 'full';
  61. elementos = $('div.blockholder.right > .blockcontent > header > h2 > strong');
  62. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  63. $("div.wrapper.pageholder").css({"min-width":"70%", "max-width":"90%"});
  64. $("div.blockholder.right").css({"min-width":"70%", "max-width":"90%"});
  65. }
  66.  
  67. if (window.location.href.indexOf('nuuvem.com.br/produtos') > -1) {
  68. full_ou_mini = 'mini';
  69. elementos = $('div.info > a.name');
  70. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  71. $("<style>.main_details, .side_details { width: 250px; }</style>").appendTo(document.documentElement);
  72. $("<style>div.metamini { float: left; }</style>").appendTo(document.documentElement);
  73. $("div.wrapper").css({"max-width":"90%", "width":"auto"});
  74. $("div#produtos").css({"display":"table"});
  75. $("div.games").css({"width":"auto", "height":"auto"});
  76. $("div.list > ul > li").css({"height":"52px", "overflow":"hidden"});
  77. $("div.info").css({"min-width":"800px", "width":"auto"});
  78. $("li div.purchase").css({"float":"right"});
  79. }
  80.  
  81. if ((window.location.href.indexOf('steamcommunity.com/id/') > -1) && (window.location.href.indexOf('/wishlist') > -1)) {
  82. full_ou_mini = 'mini';
  83. elementos = $('div.wishlistRowItem > h4');
  84. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  85. $("<style>.main_details, .side_details { width: 200px; }</style>").appendTo(document.documentElement);
  86. $("<style>div.metamini { float: left; }</style>").appendTo(document.documentElement);
  87. $("div.wishlistRow").css({"height":"auto", "overflow":"hidden", "width":"850px"});
  88. $("div.bottom_controls").css({"position":"initial"});
  89. }
  90.  
  91. if (window.location.href.indexOf('steamgifts.com') > -1) {
  92. full_ou_mini = 'full';
  93. elementos = $('.ajax_gifts > .post > .left > .title > a');
  94. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  95. $("<style>div.ajax_gifts div.left { border: 1px dotted red; }</style>").appendTo(document.documentElement);
  96. }
  97. if (window.location.href.indexOf('store.steampowered.com/app') > -1) {
  98. full_ou_mini = 'full';
  99. elementos = $('.apphub_HeaderStandardTop > .apphub_AppName');
  100. $("<style>.main_details, .side_details { display: inline-block; }</style>").appendTo(document.documentElement);
  101. $("<style>.apphub_HeaderStandardTop { height: auto !important; background-size: 100% auto; }</style>").appendTo(document.documentElement);
  102. }
  103.  
  104. // METACRITIC CONTENT
  105. if (full_ou_mini == 'full') {
  106. var inicio = /(?=<div class="summary_wrap">)/i;
  107. var fim = '<div class="module critic_user_reviews">';
  108. var classe = 'metafull';
  109. }
  110. else if (full_ou_mini == 'mini') {
  111. var inicio = /(?=<div class="section product_scores">)/i;
  112. var fim = '<div class="section product_details">';
  113. var classe = 'metamini';
  114. }
  115. else {
  116. alert('variable full_ou_mini not defined for this domain');
  117. return;
  118. }
  119.  
  120. // DOM
  121. elementos.each(function() {
  122. var elemjogo = $(this)
  123. var jogo = elemjogo.text()
  124. console.log('jogo encontrado: ' + jogo)
  125. jogo = jogo.replace(/\(MAC|NA\)*$/i, "");
  126. jogo = jogo.replace(/[\.,\/#!$%\^&\*;:{}=\_`'´’"~()]/g, "")
  127. jogo = $.trim(jogo).toLowerCase()
  128. jogo = jogo.replace(/[\s\-]+/g, '-');
  129. $(elemjogo).append("<div id='" + jogo + "' class='" + classe + "' style='display:inline-block; font-size:9px;' />")
  130. requisicao = "http://www.metacritic.com/game/pc/" + encodeURIComponent(jogo)
  131. conectar('GET', requisicao, respostametacritic)
  132.  
  133. function conectar(metodo, endereco, resposta, corpo) {
  134. console.log('pesquisando no endereco: ' + endereco)
  135. callback = function(xhr) { resposta(xhr) };
  136. GM_xmlhttpRequest({
  137. "method" : metodo,
  138. "url" : endereco,
  139. "onerror" : callback,
  140. "onload" : callback,
  141. "headers" : {'Content-Type' : 'application/x-www-form-urlencoded'},
  142. "data" : corpo
  143. });
  144. }
  145.  
  146. function respostametacritic(detalhes) {
  147. $("#" + jogo).html(detalhes.responseText.split(inicio)[1].split(fim)[0])
  148. }
  149. })
  150.  
  151. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址