-1

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?

Rick D
  • 85
  • 1
  • 9
  • So if I am not a competitor but a user of your webpage how do I use your links to get to the correct sites? – jing3142 Apr 02 '14 at 17:44
  • @jing3142 My idea is NOT to change the links unless a copy has been performed. Users will just click, not copy. – Rick D Apr 02 '14 at 17:46
  • So you want to stop competitors doing a right click and copying the link location? – jing3142 Apr 02 '14 at 17:53
  • @jing3142 No. Stopping right-click copy is easy. If I do that they will just grab the source. I want them to **think** they copied the list but manipulate it with new links. Then they will just paste in their own sites and I will get all the traffic from those links. – Rick D Apr 02 '14 at 18:00
  • So whatever method the competitors use to copy, ctrl+v, right click and copy link location etc you want to intercept the copy event and replace the real data with false data. – jing3142 Apr 02 '14 at 18:11

3 Answers3

1

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.

Stuart Feldt
  • 358
  • 1
  • 2
  • 13
  • This is a good idea, one can write a simple script that will generate the HTML/JS required from a text document of link key/value pairs to simplify the process. – Michael Tang Apr 02 '14 at 17:58
  • Stuart- this is not working for me. Did I do this correctly? http://jsfiddle.net/zL88X/ – Rick D Apr 02 '14 at 20:09
  • Whoops, forgot the 'return false;'. http://jsfiddle.net/zL88X/1/ So, if someone copies just the link, they well go to whatever is in the a tag. Someone could always steal your javascript, but at least this makes it harder. – Stuart Feldt Apr 02 '14 at 21:17
  • Thanks Stuart. Great concept. I went with Arjan because he offered a single solution that would work with all the links. – Rick D Apr 03 '14 at 18:08
1

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.

Community
  • 1
  • 1
Michael Tang
  • 4,686
  • 5
  • 25
  • 24
  • I'm not trying to keep them from copying. These are thieves, they are lazy. My hope is that they will cut/paste without checking the location of the links. If I can switch the links then I can capture the traffic from their site. – Rick D Apr 02 '14 at 20:12
  • You might want to try setting all your url's to point to your site, and intercept the onclick event of the `a` tag to send the user to the correct URL based on the `a` tag's id? (like what @start feldt suggested) – Michael Tang Apr 02 '14 at 21:42
  • That's the direction I am going... – Rick D Apr 02 '14 at 22:07
1

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?

ArjanSchouten
  • 1,360
  • 9
  • 23
  • Yes, this will work! The only giveaway is that when the user hovers over the link with their mouse they will not see the correct destination in the popup hint. I can live with that! I do not have access to the head section of the page for this project. Can this javascript be run from inside the body? My site is running jQuery 1.10. I tested but it's not working. – Rick D Apr 02 '14 at 19:33
  • Yes this can be run inside the body. I have just changed the code. I suppose that's exactly what you want. – ArjanSchouten Apr 02 '14 at 20:21
  • Thanks @arjan. You've got me close and introduced a method I hadn't considered. – Rick D Apr 03 '14 at 18:06