Created
October 6, 2013 22:58
-
-
Save larrybolt/6860232 to your computer and use it in GitHub Desktop.
Quick test of reportr!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://www.reportr.io'; | |
$apikey = 'API KEY'; | |
// Create a model, you only need to do this once, check afterwards at: | |
// http://www.reportr.io/api/API-KEY/models | |
$data = array( | |
'namespace' => 'ping', | |
'event' => 'ping', | |
'name' => 'Ping', | |
'icon' => '', | |
'description' => 'Ping test' | |
); | |
$json = json_encode($data); | |
$encoded = base64_encode($json); | |
file_get_contents("$url/api/$apikey/model/set?callback=?&data=$encoded"); | |
// Send some data to the model just created | |
$data = array( | |
'event' => 'ping', | |
'namespace' => 'ping', | |
'properties' => array( | |
time => '3', | |
title => 'test' | |
) | |
); | |
$json = json_encode($data); | |
$encoded = base64_encode($json); | |
file_get_contents("$url/api/$apikey/events/track?callback=?&data=$encoded"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment