Method | Description | |
---|---|---|
__construct ( string $tweet ) | Reads in a tweet to be parsed and extracts elements from it. | |
create ( string $tweet ) : Twitter_Extractor | Provides fluent method chaining. | |
extract ( ) : array | Extracts all parts of a tweet and returns an associative array containing the extracted elements. | |
extractCashtags ( ) : array | Extracts all the cashtags from the tweet. | |
extractCashtagsWithIndices ( ) : array | Extracts all the cashtags and the indices they occur at from the tweet. | |
extractHashtags ( ) : array | Extracts all the hashtags from the tweet. | |
extractHashtagsWithIndices ( ) : array | Extracts all the hashtags and the indices they occur at from the tweet. | |
extractMentionedUsernames ( ) : array | Extract all the usernames from the tweet. | |
extractMentionedUsernamesOrListsWithIndices ( ) : array | Extracts all the usernames and the indices they occur at from the tweet. | |
extractMentionedUsernamesWithIndices ( ) : array | Extracts all the usernames and the indices they occur at from the tweet. | |
extractRepliedUsernames ( ) : array | Extract all the usernames replied to from the tweet. | |
extractURLs ( ) : array | Extracts all the URLs from the tweet. | |
extractURLsWithIndices ( ) : array | Extracts all the URLs and the indices they occur at from the tweet. |
Method | Description | |
---|---|---|
fixMultiByteIndices ( string &$tweet, array &$matches, array &$results, array $keys, integer $tweak = 1 ) | Processes an array of matches and fixes up the offsets to support multibyte strings. This needs to be done due to the state of unicode support in PHP. |
public __construct ( string $tweet ) | ||
$tweet | string | The tweet to extract. |
public extractCashtags ( ) : array | ||
return | array | The cashtag elements in the tweet. |
public extractCashtagsWithIndices ( ) : array | ||
return | array | The cashtag elements in the tweet. |
public extractHashtags ( ) : array | ||
return | array | The hashtag elements in the tweet. |
public extractHashtagsWithIndices ( ) : array | ||
return | array | The hashtag elements in the tweet. |
public extractMentionedUsernames ( ) : array | ||
return | array | The usernames elements in the tweet. |
public extractMentionedUsernamesOrListsWithIndices ( ) : array | ||
return | array | The username elements in the tweet. |
public extractMentionedUsernamesWithIndices ( ) : array | ||
return | array | The username elements in the tweet. |
public extractRepliedUsernames ( ) : array | ||
return | array | The usernames replied to in a tweet. |
public extractURLs ( ) : array | ||
return | array | The URL elements in the tweet. |
public extractURLsWithIndices ( ) : array | ||
return | array | The URLs elements in the tweet. |
protected static fixMultiByteIndices ( string &$tweet, array &$matches, array &$results, array $keys, integer $tweak = 1 ) | ||
$tweet | string | The tweet being matched. |
$matches | array | The matches from the regular expression match. |
$results | array | The extracted results from the matches. |
$keys | array | The list of array keys to be added. |
$tweak | integer | An amount to adjust the end index by. |