Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Last active January 28, 2016 12:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save NigelThorne/6155217 to your computer and use it in GitHub Desktop.
Save NigelThorne/6155217 to your computer and use it in GitHub Desktop.
Add ESRB ratings icons to steam store. I used the "Control Freak" chrome extension to add the following script. Add a script for http://http://store.steampowered.com/ pasting the text below Add Jquery 2.0.2 (http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js) in the Libs section. Reload http://store.steampowered.com/
$(".tab_desc h4").each(function(e){
var self = $(this);
var game = $(this).text().split(" ").join("+");
// var data = {
// titleOrPublisher: self.text(),
// isIncluding: false,
// rating: "",
// ratingsCriteria: "",
// platforms: "",
// platformsCriteria: "--All Platforms--",
// searchVersion: "compact",
// content: "",
// searchType: "title",
// contentCriteria: "",
// newSearch: {x: 802, y: 400}
// };
var data = "titleOrPublisher="+game+"&isIncluding=false&rating=&ratingsCriteria=&platforms=Linux%2CMacintosh%2CPC+DVD%2CPC+DVD-ROM%2CWindows+CE%2CWindows+PC%2CWindows+8+App&platformsCriteria=Linux%2CMacintosh%2CPC+DVD%2CPC+DVD-ROM%2CWindows+CE%2CWindows+PC%2CWindows+8+App&searchVersion=compact&content=&searchType=title&contentCriteria=&newSearch.x=802&newSearch.y=400";
window.console&&console.log("search for: "+game);
$.post(
"http://www.esrb.org/ratings/search.jsp",
data,
function(data){
var img = $(data).find(".results .ratingiconwidth img").first();
var game_title = img.parents("tbody").first().find("strong").first().text();
var text = img.parents("tbody").first().find("strong").parent().last().text();
img.attr("src", img.attr("src").replace("..", "http://www.esrb.org"));
self.after(img);
self.after($("<span>"+game_title+"</br>"+text+"</span>"));
}).fail(
function(data){self.after($("<p>Can't find it</p>"));});
});
$(".tab_desc h4").each(function(e){
var self = $(this);
var game = $(this).text().split(" ").join("+");
var data = {
titleOrPublisher: self.text(),
isIncluding: false,
// rating: "",
// ratingsCriteria: "",
// platforms: "",
// platformsCriteria: "--All Platforms--",
searchVersion: "compact",
// content: "",
searchType: "title",
// contentCriteria: "",
// newSearch: {x: 802, y: 400}
};
// var data = "titleOrPublisher="+game+"&isIncluding=false&rating=&ratingsCriteria=&platforms=Linux%2CMacintosh%2CPC+DVD%2CPC+DVD-ROM%2CWindows+CE%2CWindows+PC%2CWindows+8+App&platformsCriteria=Linux%2CMacintosh%2CPC+DVD%2CPC+DVD-ROM%2CWindows+CE%2CWindows+PC%2CWindows+8+App&searchVersion=compact&content=&searchType=title&contentCriteria=&newSearch.x=802&newSearch.y=400";
window.console&&console.log("search for: "+game);
$.post(
"http://www.esrb.org/ratings/search.jsp",
data,
function(data){
var img = $(data).find(".results .ratingiconwidth img").first();
var game_title = img.parents("tbody").first().find("strong").first().text();
var text = img.parents("tbody").first().find("strong").parent().last().text();
img.attr("src", img.attr("src").replace("..", "http://www.esrb.org"));
self.after(img);
self.after($("<span>"+game_title+"</br>"+text+"</span>"));
}).fail(
function(data){self.after($("<p>Can't find it</p>"));});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment