Skip to content

Instantly share code, notes, and snippets.

@TBD
Created August 29, 2015 19:31
Show Gist options
  • Save TBD/851b7a59f480061632d4 to your computer and use it in GitHub Desktop.
Save TBD/851b7a59f480061632d4 to your computer and use it in GitHub Desktop.
IKEA price check
javascript:(function(){var request=new XMLHttpRequest();request.open("GET",window.location.href.replace(/ro\//g,'hu/'),false);request.send(null);var hidden=document.body.appendChild(document.createElement("div"));hidden.style.display="none";hidden.innerHTML=request.responseText;price=hidden.querySelector('#schemaProductPrice');if(price){price=parseInt(hidden.querySelector('#schemaProductPrice').textContent.replace(/\./gm,''));price=(price*1.41/100).toFixed(2)+" lei ( "+price+" HUF )";}else{price="N/A";}price_hu=document.createElement("div");price_hu.innerHTML=price;refNode=document.querySelector('#price1');refNode.parentNode.insertBefore(price_hu,refNode.nextSibbling);})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment