News for hackers. Stuff that matters.
Re:Is running ads on a programming blog worth it? by slig on Monday January 26, 2015 @10:42AM (#8947550)
> There's no (easy) way to send US traffic to the Amazon.com site

You can run a small snippet of JS that replaces all the links with amazon.co.uk to amazon.com. You have to figure out that the user is from the US (maybe reading the Accept-Language, don't know if that's reliable)

    // untested
    var links = document.getElementsByTagName('a');
    for (i=0; i<links.length; i++){
        var link = links[i];
        if (link.href.match(/amazon.co.uk/))
            link.href = link.href.replace('.co.uk', '.com')
    }
Re:Is running ads on a programming blog worth it? by unwiredben on Monday January 26, 2015 @11:27AM (#8947826)
navigator.language will return a string like "en-US", "en-GB", or "fr-FR" depending on the user's selected locale. That could be used to map different Amazon URLs, although it looks like you may get a fair number of en-US false reports. See https://html.spec.whatwg.org/multipage/webappapis.html#navig....