Returns tweets that match a specified query.
public searchTweets ( string $q, string[optional] $geocode = null, string[optional] $lang = null, string[optional] $locale = null, string[optional] $resultType = null, int[optional] $count = null, string[optional] $until = null, string[optional] $sinceId = null, string[optional] $maxId = null, bool[optional] $includeEntities = null ) : array | ||
$q | string | A UTF-8, URL-encoded search query of 1,000 characters maximum, including operators. Queries may additionally be limited by complexity. |
$geocode | string[optional] | |
$lang | string[optional] | |
$locale | string[optional] | |
$resultType | string[optional] | |
$count | int[optional] | |
$until | string[optional] | |
$sinceId | string[optional] | |
$maxId | string[optional] | |
$includeEntities | bool[optional] | |
Результат | array |
/** * Tests Twitter->searchTweets() */ public function testSearchTweets() { $response = $this->twitter->searchTweets('#freebandnames'); $this->assertArrayHasKey('statuses', $response); foreach ($response['statuses'] as $row) { $this->isTweet($row); } $this->assertArrayHasKey('search_metadata', $response); $this->assertArrayHasKey('completed_in', $response['search_metadata']); $this->assertArrayHasKey('max_id', $response['search_metadata']); $this->assertArrayHasKey('query', $response['search_metadata']); $this->assertArrayHasKey('refresh_url', $response['search_metadata']); $this->assertArrayHasKey('count', $response['search_metadata']); $this->assertArrayHasKey('since_id', $response['search_metadata']); }