diff --git a/bc-papi.php b/bc-papi.php index 8840275..5381ccd 100644 --- a/bc-papi.php +++ b/bc-papi.php @@ -129,6 +129,18 @@ public function find($call, $type = 'videos', $id = NULL) return $this->getData($url); } + + /** + * @param string $type + * @param string $terms (e.g. tags:sea,mammal or tags:nature,name:nature) + * @param string $sort (default - "updated_at", OTHER - "name", "reference_id", "created_at", "published_at", "schedule_starts_at", "schedule_ends_at", "state", "plays_total", "plays_trailing_week") + * @return object + */ + public function search($type = 'videos', $terms = '', $sort='updated_at') + { + $url = $this->url_read . $this->bc_account . '/' . $type . '?q='. $terms.'&sort='.$sort; + return $this->getData($url); + } /** @@ -398,4 +410,4 @@ class BCPAPIInvalidProperty extends BCPAPIException{} class BCPAPIInvalidType extends BCPAPIException{} class BCPAPITokenError extends BCPAPIException{} -?> \ No newline at end of file +?>