Skip to content

Commit

Permalink
Cleaned new extended param for SearchFeed
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 21, 2018
1 parent c4ab084 commit 8a44b21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
21 changes: 11 additions & 10 deletions README.md
Expand Up @@ -24,18 +24,18 @@ $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',
'twitter_consumer_key',
'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(
[
Expand All @@ -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
),
]);

Expand Down
8 changes: 5 additions & 3 deletions src/TwitterSearchFeed.php
Expand Up @@ -45,7 +45,7 @@ class TwitterSearchFeed extends AbstractTwitterFeed
/**
* @var bool
*/
protected $extended = true;
protected $extended = false;

/**
* @var string
Expand All @@ -65,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,
Expand Down Expand Up @@ -124,8 +124,10 @@ protected function getFeed($count = 5)
"q" => $this->formatQueryParams(),
"count" => $count,
"result_type" => $this->resultType,
'tweet_mode' => ($this->extended ? 'extended' : '')
];
if ($this->extended) {
$params['tweet_mode'] = 'extended';
}

$body = $this->twitterConnection->get("search/tweets", $params);

Expand Down

0 comments on commit 8a44b21

Please sign in to comment.