Pregunta

I have a list of links that I worked hard to create and I want to publish on a webpage. My competitors will steal this list within days if not hours. I realize that it's not possible to protect this data. That being said, I'd like to try to trick a few of my competitors.

My idea is do a sort of bait-and-switch by providing an alternate list that looks identical but with some sneaky changes. The links in my list point to many different websites. I'd like to provide would be thieves with links that all point back to my website.

Most of my competitors are not very technical. If they were they'd just grab the list from the source. I doubt any of them would even test the links after copy/paste.

So, is this possible?

¿Fue útil?

Solución

I think this is what you're looking for.

Some javascript:

$(document).ready(function(){
    var a = Array('http://www.example.com');
    if(window.location.host == "fiddle.jshell.net"){
        $('a').each(function(){
            if(a[$(this).attr('id')]){
                 $(this).attr('href',a[$(this).attr('id')]);   
            }
        });
    }
});

Some small html:

<a href="http://www.yourdomain.com" id="0">Example</a>

You can check it here

What I did is checking if the domain is your domain. In this example I had to use the location host of the iframe of jsfiddle. If a competitor copies the html then all links goes to your domain.

Is this what youre looking for?

Otros consejos

You can intercept the keydown event on the document when a user is pressing control and c or x on a particular document element.

Check out this stackoverflow question on an example: How to detect ctrl+v ,Ctrl+c using Javascript?.

You can also bind to the window.oncopy event.

Modifying the list of links copied is simply modifying the DOM and then reverting it shortly after.

Note that modifying copy behavior will likely not solve the problems, as if the links are available to legitimate users, then it is also available to your competitors.

You could listen for onclick events via javascript and not show the actual links.

<a id="link1" href="{t.co link to your site}">Link Name</a>

<script>
document.getElementById('link1').onclick=function(){window.location.href = 'Real URL';};
return false;
</script>

Might be a pain to do this for all of your links, but may be worth it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top