Browse files

Created YouTube by extending Google and adding an extra default scope.

  • Loading branch information...
1 parent 5833285 commit 3b65d1e5f9418f6d11e493d57c9afb3683daf09a @philsturgeon philsturgeon committed Nov 21, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 classes/provider/youtube.php
View
23 classes/provider/youtube.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace OAuth2;
+
+class Provider_Youtube extends Provider_Google {
+
+ public $name = 'youtube';
+
+ public function __construct(array $options = array())
+ {
+ // Now make sure we have the default scope to get user data
+ $options['scope'] = \Arr::merge(
+
+ // We need this default feed to get the authenticated users basic information
+ array('https://www.google.com/m8/feeds', 'http://gdata.youtube.com'),
+
+ // And take either a string and array it, or empty array to merge into
+ (array) \Arr::get($options, 'scope', array())
+ );
+
+ parent::__construct($options);
+ }
+}

0 comments on commit 3b65d1e

Please sign in to comment.