<?php require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/twitter-essentials.php'; use nehrke\socialwall\twitter\Twitter; use nehrke\socialwall\twitter\TwitterParameters; $twitter = new Twitter(CONSUMER_KEY, CONSUMER_SECRET); $parameters = TwitterParameters::createByQuery('#lego'); $parameters->count = TwitterParameters::MAX_COUNT; $searchResult = $twitter->search($parameters); foreach ($searchResult->statuses as $tweet) { echo 'User: '******'Text: ' . $tweet->getText() . PHP_EOL; foreach ($tweet->getEntities()->getMedia() as $img) { echo ' Img: ' . $img->getMediaUrlHttps() . PHP_EOL; } }
/** * @param string $query * @param array $options * @return SearchResult */ public function searchByQuery($query, $options = array()) { $parameters = TwitterParameters::createByQuery($query, $options); return $this->searchByParameters($parameters); }