Skip to content

Instantly share code, notes, and snippets.

@hyusetiawan
Created June 6, 2012 19:05
Show Gist options
  • Save hyusetiawan/2883970 to your computer and use it in GitHub Desktop.
Save hyusetiawan/2883970 to your computer and use it in GitHub Desktop.
Using Blitz with PHP
<?php
require_once 'blitz_api.php';
class MyBlitzListener extends BlitzListener {
//will provide the result on the test completed
public function on_complete($result){
echo var_dump($result);
}
//will provide status data as it polls the API
public function on_status($result){
echo var_dump($result);
}
}
//acquire the username and api key from your blitz settings
$blitz_api = new BlitzApi(<username>, <api key>);
$blitz_api->listener = new MyBlitzListener();//extends from blitz_listener
$blitz_api->curl('-r california -p 1-1000:60 http://test.blitz.io');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment