public static function listHistorics($user, $page = 1, $per_page = 20)
{
try {
$res = $user->post('historics/get', array('page' => $page, 'max' => $page));
$retval = array('count' => $res['count'], 'historics' => array());
foreach ($res['data'] as $historic) {
$retval['historics'][] = new self($user, $historic);
}
return $retval;
} catch (DataSift_Exception_APIError $e) {
switch ($e->getCode()) {
case 400:
// Missing or invalid parameters
throw new DataSift_Exception_InvalidData($e->getMessage());
default:
throw new DataSift_Exception_APIError('Unexpected APIError code: ' . $e->getCode() . ' [' . $e->getMessage() . ']');
}
}
}