diff --git a/lib/Phirehose.php b/lib/Phirehose.php index bcf21db..ce1af9a 100644 --- a/lib/Phirehose.php +++ b/lib/Phirehose.php @@ -50,6 +50,9 @@ abstract class Phirehose protected $filterChanged; protected $reconnect; + // Generic default params + protected $requestParams = array(); + /** * The number of tweets received per second in previous minute; calculated fresh * just before each call to statusUpdate() @@ -190,6 +193,26 @@ public function __construct($username, $password, $method = Phirehose::METHOD_SA } } + /** + * Add default param for the request + * Generic function if a special function do not exists (ie: setFollow, setLang ) + * @param name and value + */ + public function setRequestParam( $paramName, $paramValue ) + { + $this->requestParams[ $paramName ] = $paramValue; + // $this->filterChanged = TRUE; + } + + /** + * Returns an array of the default params for the request + */ + public function getRequestParams() + { + return $this->requestParams; + } + + /** * Returns public statuses from or in reply to a set of users. Mentions ("Hello @user!") and implicit replies * ("@user Hello!" created without pressing the reply button) are not matched. It is up to you to find the integer @@ -596,7 +619,8 @@ protected function connect() $urlParts = parse_url($url); // Setup params appropriately - $requestParams=array(); + // Init with default params + $requestParams = $this->requestParams; //$requestParams['delimited'] = 'length'; //No, we don't want this any more