Beispiel #1
0
        foreach ($files as $file) {
            if (is_file($file)) {
                unlink($file);
            }
        }
    } else {
        $url = $_POST["url"];
        $format = $_POST["format"];
        try {
            $grabzIt = new GrabzItClient($grabzItApplicationKey, $grabzItApplicationSecret);
            if ($format == "pdf") {
                $grabzIt->SetPDFOptions($url);
            } else {
                $grabzIt->SetImageOptions($url);
            }
            $grabzIt->Save($grabzItHandlerUrl);
        } catch (Exception $e) {
            $message = $e->getMessage();
        }
    }
}
?>
<html>
<head>
<title>GrabzIt Demo</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="ajax/ui.js"></script>
</head>
<body>
<h1>GrabzIt Demo</h1>
Beispiel #2
0
 function make_images($user)
 {
     $files = $this->projects[$user]["files"]["html"];
     if (!$files) {
         echo "pole html/PHP faile  <br>";
         return;
     }
     $grabzItHandlerUrl = $this->base_url . "lib/webimg/handler.php";
     $i = 0;
     try {
         global $grabzItApplicationKey, $grabzItApplicationSecret;
         foreach ($files as $file) {
             $grabzIt = new GrabzItClient($grabzItApplicationKey, $grabzItApplicationSecret);
             $grabzIt->SetImageOptions($this->base_url . $file, $user . "-" . $i++, null, null);
             $grabzIt->Save($grabzItHandlerUrl);
         }
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }