<? //    $path = '/var/www/images/'; // URL       $web = 'http://kih.kz/images/'; function screenshot($source,$filename) { system('xvfb-run --server-args="-screen 0, 1024x768x24" /usr/ccapt/cutycapt/CutyCapt/CutyCapt --url=http://'.$source.' --out=/var/www/images/'.$filename); } if(!isset($_POST['url'])) { print '<html>'. '<head>'. '<title>  </title>'. '</head>'. '<body>'; print '<form action="" method="post">'. 'URL:<br />'. '<input name="url" type="text" value="http://">'. '<input type="submit" value="Send">'. '</form>'; print '</body>'. '</html>'; } else { //      .   url  host $site = parse_url($_POST['url']); //          $filename = str_ireplace('.','_',$site["host"]).'.jpg'; //     if(file_exists($path.$filename)) { //     -    if (system('find '.$path.' -type f -name '.$filename.' -mtime -1')) { print ',          !<br />'; print '<a href="'.$web.$filename.'">'.$web.$filename.'</a>'; } else { screenshot($site["host"],$filename); print '<a href="'.$web.$filename.'">'.$web.$filename.'</a>'; } } else { screenshot($site["host"],$filename); print '<a href="'.$web.$filename.'">'.$web.$filename.'</a>'; } } ?> Source: https://habr.com/ru/post/128292/
All Articles