diff --git a/README.md b/README.md index d1c90a6..96438c5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ $feed = new MixedFeed([ new InstagramFeed( 'instagram_user_id', 'instagram_access_token', - // you can add a doctrine cache provider + null // you can add a doctrine cache provider ), new TwitterFeed( 'twitter_user_id', @@ -32,10 +32,10 @@ $feed = new MixedFeed([ 'twitter_consumer_secret', 'twitter_access_token', 'twitter_access_token_secret', - // you can add a doctrine cache provider - // exclude replies true/false - // include retweets true/false - // extended mode true/false + null, // you can add a doctrine cache provider + true, // exclude replies true/false + false, // include retweets true/false + false // extended mode true/false ), new TwitterSearchFeed( [ @@ -48,23 +48,24 @@ $feed = new MixedFeed([ 'twitter_consumer_secret', 'twitter_access_token', 'twitter_access_token_secret', - // you can add a doctrine cache provider + null, // you can add a doctrine cache provider + false // extended mode true/false ), new FacebookPageFeed( 'page-id', 'app_access_token', - // you can add a doctrine cache provider - // And a fields array to retrieve too + null, // you can add a doctrine cache provider + [] // And a fields array to retrieve too ), new GithubCommitsFeed( 'symfony/symfony', 'access_token', - // you can add a doctrine cache provider + null // you can add a doctrine cache provider ), new GithubReleasesFeed( 'roadiz/roadiz', 'access_token', - // you can add a doctrine cache provider + null // you can add a doctrine cache provider ), ]); diff --git a/composer.json b/composer.json index 70721fb..4f52803 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "rezozero/mixedfeed", "description": "A PHP library to get social networks feeds and merge them", "license": "MIT", + "type": "library", "authors": [ { "name": "Ambroise Maupate", diff --git a/src/TwitterSearchFeed.php b/src/TwitterSearchFeed.php index 751679e..d0b2ada 100644 --- a/src/TwitterSearchFeed.php +++ b/src/TwitterSearchFeed.php @@ -42,6 +42,11 @@ class TwitterSearchFeed extends AbstractTwitterFeed */ protected $includeRetweets = true; + /** + * @var bool + */ + protected $extended = false; + /** * @var string */ @@ -60,7 +65,7 @@ class TwitterSearchFeed extends AbstractTwitterFeed * @param string $accessToken * @param string $accessTokenSecret * @param CacheProvider|null $cacheProvider - * @throws Exception\CredentialsException + * @param bool $extended */ public function __construct( array $queryParams, @@ -68,7 +73,8 @@ public function __construct( $consumerSecret, $accessToken, $accessTokenSecret, - CacheProvider $cacheProvider = null + CacheProvider $cacheProvider = null, + $extended = false ) { parent::__construct( $consumerKey, @@ -80,6 +86,7 @@ public function __construct( $this->queryParams = array_filter($queryParams); $this->cacheKey = $this->getFeedPlatform() . md5(serialize($queryParams)); + $this->extended = $extended; } /** @@ -118,6 +125,9 @@ protected function getFeed($count = 5) "count" => $count, "result_type" => $this->resultType, ]; + if ($this->extended) { + $params['tweet_mode'] = 'extended'; + } $body = $this->twitterConnection->get("search/tweets", $params);