PHP Classes
elePHPant
Icontem

File: Examples/get_screenshot.php

Recommend this page to a friend!
  Classes of Christian Vigh  >  ApiLayer API Encapsulation  >  Examples/get_screenshot.php  >  Download  
File: Examples/get_screenshot.php
Role: Example script
Content type: text/plain
Description: Example to demonstrate the use of the ScreenshotLayer api
Class: ApiLayer API Encapsulation
Send requests to APILayer REST APIs
Author: By
Last change:
Date: 3 years ago
Size: 487 bytes
 

 

Contents

Class file image Download
<?php
   
require ( '../Sources/ScreenshotLayer.php' ) ;

   
$my_access_key = "YOUR_ACCESS_KEY" ;
   
$my_secret_key = "YOUR_SECRET_KEY" ; // Or null, if you defined no secret key in your dashboard
   
$use_https = false ;

   
$screenshot = new ScreenShotLayer ( $my_access_key, $my_secret_key, $use_https ) ;
   
$screenshot -> Format = ScreenshotLayer::FORMAT_PNG ;
   
$image = $screenshot -> CapturePage ( "http://www.google.com" ) ;
   
file_put_contents ( 'google.png', $image ) ;