PHP Classes

File: test-fetch.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Webcam Fetch   test-fetch.php   Download  
File: test-fetch.php
Role: Example script
Content type: text/plain
Description: Sample application
Class: PHP Webcam Fetch
Capture images from a remote webcam
Author: By
Last change:
Date: 9 years ago
Size: 746 bytes
 

Contents

Class file image Download
<?php
/**
 * This file provides a simple test application
 *
 * @author Maik Greubel <greubel@nkey.de>
 */
require 'WebcamFetch.php';

try
{
 
// Hopefully this cam is accessible for free (link taken from http://www.webcams.travel/webcam/1306724646-Weather-Acapulco-Icacos)
 
$webcam = new WebcamFetch("http://webcamsdemexico.net/acapulco1/live.jpg", 80, "acapulco.jpeg", 300);
 
$webcam->checkIsNew();
 
$webcam->retrieve();
 
$webcam->shrink();
 
 
// If you want to use the script in your own website and not in cronjob, you honestly want to send the data to client...
  //$webcam->sendToClient();
}
catch(
Exception $ex)
{
 
printf("%s occured: %s\n%s\n", get_class($ex), $ex->getMessage(), $ex->getTraceAsString());
}