Cześć, kolega napisał mi krótki kod aczkolwiek nie działa dla mnie na stronie
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://app.lotto.pl/wyniki/?type=".$_GET['type']."");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl-PL; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
$server_output = curl_exec ($ch);
curl_close ($ch);
// Set the content-type
header('Content-Type: image/png');
// Create the image
$im = imagecreatetruecolor(150, 150);
function skrut($c,$d) {
if(strlen($c) > $i) { //sprawdzanie czy tekst jest dłuzszy niz ustaliliśmy $ciag = substr($c,0
,$d); //jesli tak, to obcina ciąg... $ciag .=""; //...dodaje kropki...
return $ciag; //... i zwraca zmodyfikowany ciąg
}
else return $c; //jesli nie to zwraca wprowadzony ciąg
}
// 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, 250, 180, $white);
$go = imagecreatefrompng('http://lotto-sposob.pl/wp-content/uploads/2016/02/lotto-250x250.png');
imagecopy($im, $go,25,25,10,50,250,250);
imagedestroy($go);
// The text to draw
$text = "20".$server_output[2].$server_output[3].$server_output[4].$server_output[5].$server_output[6].$server_output[7].$server_output[8].$server_output[9].$server_output[10];
$text2 = $server_output[11].$server_output[12].$server_output[13].$server_output[14].$server_output[15].$server_output[16].$server_output[17].$server_output[18].$server_output[19].$server_output[20].$server_output[21].$server_output[22].$server_output[23].$server_output[24].$server_output[25].$server_output[26];
$strxx = array('', '', ''); // kasowanie @ pukawka.pl i zabijaka.pl $str2xx = array('-', 'w', ''); // na co zamienic @ pukawka.pl i zabijaka.pl // Replace path by your own font path
$font = 'visitor.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 0, 11, 34, $grey, $font, $text2);
// 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);
?>
Skrypt znajduję się pod tym linkiem -
https://lottoforum.pl/wyniki/