Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default requestParams #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion lib/Phirehose.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down