메소드 |
설명 |
|
__construct ( string $username, string $password, string $method = Phirehose::METHOD_SAMPLE, string $format = self::FORMAT_JSON ) |
Create a new Phirehose object attached to the appropriate twitter stream method. |
|
consume ( boolean $reconnect = TRUE ) |
Connects to the stream API and consumes the stream. Each status update in the stream will cause a call to the
handleStatus() method. |
|
enqueueStatus ( string $status ) |
This is the one and only method that must be implemented additionally. As per the streaming API documentation,
statuses should NOT be processed within the same process that is performing collection |
|
getFollow ( ) : array |
Returns an array of followed Twitter userIds (integers) |
|
getLastErrorMsg ( ) : string |
Returns the last error message (TCP or HTTP) that occured with the streaming API or client. State is cleared upon
successful reconnect |
|
getLastErrorNo ( ) : string |
Returns the last error number that occured with the streaming API or client. Numbers correspond to either the
fsockopen() error states (in the case of TCP errors) or HTTP error codes from Twitter (in the case of HTTP errors). |
|
getLocations ( ) : array |
Returns an array of 4 element arrays that denote the monitored location bounding boxes for tweets using the
Geotagging API. |
|
getTrack ( ) : array |
Returns an array of keywords being tracked |
|
setCount ( integer $count ) |
Sets the number of previous statuses to stream before transitioning to the live stream. Applies only to firehose
and filter + track methods. This is generally used internally and should not be needed by client applications. |
|
setFollow ( array $userIds ) |
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
IDs of each twitter user. |
|
setLocations ( array $boundingBoxes ) |
Specifies a set of bounding boxes to track as an array of 4 element lon/lat pairs denoting ,
. Only tweets that are both created using the Geotagging API and are placed from within a tracked
bounding box will be included in the stream. The user's location field is not used to filter tweets. Bounding boxes
are logical ORs and must be less than or equal to 1 degree per side. A locations parameter may be combined with
track parameters, but note that all terms are logically ORd. |
|
setLocationsByCircle ( $locations ) |
Convenience method that sets location bounding boxes by an array of lon/lat/radius sets, rather than manually
specified bounding boxes. Each array element should contain 3 element subarray containing a latitude, longitude and
radius. Radius is specified in kilometers and is approximate (as boxes are square). |
|
setTrack ( array $trackWords ) |
Specifies keywords to track. Track keywords are case-insensitive logical ORs. Terms are exact-matched, ignoring
punctuation. Phrases, keywords with spaces, are not supported. Queries are subject to Track Limitations. |
|