Skip to content

Instantly share code, notes, and snippets.

@mageddo
Last active March 26, 2020 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mageddo/c31b7483f667b9a441ece49f7049ad70 to your computer and use it in GitHub Desktop.
Save mageddo/c31b7483f667b9a441ece49f7049ad70 to your computer and use it in GitHub Desktop.
Steam wishlist JSON generator
var games = [];
jQuery(".wishlist_row").each(function(){
games.push(toGame(jQuery(this)));
});
var str = "";
games.forEach(it => {
str += it.name + "\t" + it.originalPrice + "\t" + it.price + "\n";
});
console.log(str);
function toGame(o){
return {
name: o.find(".title").text().trim(),
originalPrice: o.find(".discount_original_price").text().trim(),
price: o.find(".discount_final_price").text().trim(),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment