diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 42f55ce..4df5a79 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -10,6 +10,17 @@ class InstagramBridge extends BridgeAbstract { 'u' => array( 'name' => 'username', 'required' => true + ), + 'media_type' => array( + 'name' => 'Media type', + 'type' => 'list', + 'required' => false, + 'values' => array( + 'Both' => 'all', + 'Video' => 'video', + 'Picture' => 'picture' + ), + 'defaultValue' => 'all' ) )); @@ -39,6 +50,18 @@ class InstagramBridge extends BridgeAbstract { $userMedia = $data->entry_data->ProfilePage[0]->user->media->nodes; foreach($userMedia as $media){ + // Check media type + switch($this->getInput('media_type')){ + case 'all': break; + case 'video': + if($media->is_video === false) continue 2; + break; + case 'picture': + if($media->is_video === true) continue 2; + break; + default: break; + } + $item = array(); $item['uri'] = self::URI . 'p/' . $media->code . '/'; $item['content'] = '';