Skip to content

Commit

Permalink
[#65] added retweet filter option to api
Browse files Browse the repository at this point in the history
  • Loading branch information
j-h-s committed Feb 12, 2018
1 parent 3882607 commit d033e8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AppBundle/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function partyAction($id) {
* {"name"="type", "dataType"="string", "required"="false", "description"="Get only Facebook, Twitter or YouTube posts", "pattern"="fb | tw | yt"},
* {"name"="sub_type", "dataType"="string", "required"="false", "description"="Get only text posts, images, videos or events", "pattern"="t | i | v | e"},
* {"name"="fields", "dataType"="string", "requied"="false", "description"="Choose specific fields to be returned, separated by commas (e.g. 'text,time,img_source')",
* "pattern"="time | updated | text | description | image | img_source | album | link | url | likes | reactions | comments | shares | views | total_engagement | audience_reach | reach_per_capita | place | address | attending | interested"},
* "pattern"="time | updated | text | description | image | img_source | album | link | url | likes | reactions | comments | shares | views | total_engagement | audience_reach | reach_per_capita | place | address | attending | interested | no_retweets"},
* {"name"="order_by", "dataType"="string", "required"="false", "description"="Order to return results", "pattern"="code | likes | date"},
* {"name"="direction", "dataType"="string", "required"="false", "description"="Order to sort results", "pattern"="asc | desc"},
* {"name"="limit", "dataType"="int", "required"="false", "description"="Number of results to return (default 100)"},
Expand Down
4 changes: 4 additions & 0 deletions src/AppBundle/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ public function getSelectSocial($socialMedia, $fields) {
foreach ($socialMedia as $social) {
$data = $social->getPostData();

if (in_array('no_retweets', $terms) && !empty($data['reply_to'])) {
continue;
}

$temp = [
'code' => $social->getCode(),
'type' => $social->getType(),
Expand Down

0 comments on commit d033e8e

Please sign in to comment.