Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 21, 2018
2 parents 5f7f03e + 8a44b21 commit 63eb681
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 12 additions & 2 deletions src/TwitterSearchFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class TwitterSearchFeed extends AbstractTwitterFeed
*/
protected $includeRetweets = true;

/**
* @var bool
*/
protected $extended = false;

/**
* @var string
*/
Expand All @@ -60,15 +65,16 @@ 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,
$consumerKey,
$consumerSecret,
$accessToken,
$accessTokenSecret,
CacheProvider $cacheProvider = null
CacheProvider $cacheProvider = null,
$extended = false
) {
parent::__construct(
$consumerKey,
Expand All @@ -80,6 +86,7 @@ public function __construct(

$this->queryParams = array_filter($queryParams);
$this->cacheKey = $this->getFeedPlatform() . md5(serialize($queryParams));
$this->extended = $extended;
}

/**
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 63eb681

Please sign in to comment.