As many of you may already know I have been having issues with another site copying text from my site. The data is sports results that at first are not fully accurate because data is submitted at the event and people have to type in people's hand writing that can be difficult to read as well as other issues related to transferring data. Currently I am stuffing the text with fake text. It is working in part very well. They are still copying the text, but they are removing the fake text manually (which takes them about 2 hours longer hehe). I want to make it even more difficult for them. I would like to change some of the text automatically to images. This will require them to type these portions out. What is a good premade class for this?
I suppose you could use the GD library, that is bundled with PHP, to generate images from text.
Something like this, for instance, might do (adapted from the example given on the page of imagettftext
) :
header('Content-type: image/png');
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// The text to draw
$text = 'Hello, World!';
// Replace path by your own font path
$font = '/usr/share/fonts/truetype/msttcorefonts/verdana.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
die;
But note that using images instead of text has some drawbacks :
- on the server side, it requires more work
- on the client side :
- it'll take more time to load
- it will not necessarily use the same fonts as the rest of the site (possibly depending of the brower's configuration)
- fonts will not necessarily have the same size as the rest of the site (same note)
- using images might not be good for people who zoom -- especially people who don't see well.
How about adding some form of disclaimer to the text ("this text created by xyz.com, on dd/mm/yyyy, for more up-to-date information visit our site")? Use their use of your text as a promotional tool for your own site. Also, get in touch with them, see if they'd be interested in using your site via some form of API, this reduces their workload and allows you a little more control over their use (at least in theory).
My argument is that if the stuff you're writing up is factual there's no copyright infringement (so far as I can tell), and they may appeal to a different audience than your own, so you may as well use them as a promotional tool to broaden your own audience.