From 53307963a544452419597509bc8a4c7b9bfc0366 Mon Sep 17 00:00:00 2001 From: Jason Leung Date: Wed, 2 Nov 2016 19:56:08 +0800 Subject: [PATCH] Update README.md --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 91e76ad..e769392 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,18 @@ Please read the wiki on how to use this library with [PHP with composer](https:/ For the functions implemented in this library, please visit [API Reference](https://github.com/madcoda/php-youtube-api/wiki/api-reference) +### Example usage with pure PHP (with composer) +```php +require 'vendor/autoload.php'; +$youtube = new Madcoda\Youtube\Youtube(array('key' => '* Your API key here *')); +$video = $youtube->getVideoInfo('rie-hPVJ7Sw'); +``` + +### Example usage with Laravel 4/5 +```php +$video = Youtube::getVideoInfo(Input::get('vid', 'dQw4w9WgXcQ'); +``` + ## Format of returned data The returnd json is decoded as PHP objects (not Array). @@ -48,4 +60,4 @@ or send email to jason@madcoda.com :) ## License -Madcoda php-youtube-api is licensed under the [MIT License](http://opensource.org/licenses/MIT). \ No newline at end of file +Madcoda php-youtube-api is licensed under the [MIT License](http://opensource.org/licenses/MIT).