-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
52 lines (38 loc) · 1.05 KB
/
example.php
File metadata and controls
52 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Example for using gong PHP SDK
*
*
* @category Gong SDK Example
* @package gong-php-sdk
* @author Pasqui Andrea <a.pasqui@holocron.it>
* @copyright 2017-2018 Holocron
* @link http://holocron.it/gong/sdk/
*/
// Include the class
require "gong.php";
echo 'Starting gong SDK...';
$Gong = new Gong( 'gdlZD3RjcsqJk2B05qbstUtIrpP1IIJ0dl7NgPIzCcdSF0ZztB' ); // Use default host and port
//$Gong = new Gong( 'myapikey' , 'myCustomHost' , mycustomPort );
if($Gong->isReady()){
echo '<pre>';
var_dump($Gong->getAvalableCrawler());
echo '</pre>';
}else{
die('Error connecting to gong, check host and port');
}
$packetToSend = array(
'ip' => '192.168.1.1',
'code' => 200,
'path' => '/',
'agent' => 'Mozilla 1.0'
);
$Gong->pushData( 'apache-2' , 'test.com' , $packetToSend );
$Gong->pushData( 'apache-2' , 'test.com' , $packetToSend );
$Gong->pushData( 'apache-2' , 'test.com' , $packetToSend );
$Gong->pushData( 'apache-2' , 'test.it' , $packetToSend );
$r = $Gong->send();
echo '<pre>';
var_dump($r);
echo '</pre>';
?>