\YouTubeFeed
Class YouTubeFeed
Provides YouTube user profile access
Synopsis
class YouTubeFeed
extends Controller
{
- // members
- private Google_Client $client;
- private Google_Service_YouTube $service;
- private string $stateSessionIdentifier = 'YouTubeFeed_State';
- private static array $allowed_actions = ;
- // methods
- public void __construct()
- public SS_HTTPResponse|string authenticate()
- public string getAuthURL()
- public string getIsAuthenticated()
- public array getRecentUploads()
- protected YouTubeVideo processVideo()
- protected mixed getConfigToken()
- protected void setConfigToken()
- protected SS_Datetime getTimeLastSaved()
- public void doAutoUpdate()
- public string getBaseThumbnailDir()
- public string getThumbnailDir()
- public Image saveThumbnailFromUrl()
- public mixed getFileExtension()
Hierarchy
Extends
- Controller
Members
private
- $allowed_actions — array
- $client — Google_Client
- $service — Google_Service_YouTube
- $stateSessionIdentifier — string
Methods
protected
- getConfigToken() — Returns the access token from SiteConfig
- getTimeLastSaved() — Returns the SS_Datetime a YouTubeVideo was last retrieved from the external service
- processVideo() — Saves a Google_Service_YouTube_PlaylistItem into YouTubeVideo Overwrites an existing object, or creates a new one.
- setConfigToken() — Saves the access token into SiteConfig
public
- __construct() — Instantiate the Google API and feed provided config values We require a long-lived access token
- authenticate() — Provides an endpoint to complete YouTube OAuth
- doAutoUpdate() — Checks if it's time to do a video update, or performs one anyway if $force is true
- getAuthURL() — Returns a URL the user can visit to grant us permission to access their feed
- getBaseThumbnailDir() — Returns the thumbnail directory, if it does not exist it will attempt to create it.
- getFileExtension() — Returns the extension from a filename. Used for thumbnail saving
- getIsAuthenticated() — Returns true if the user has a valid access token
- getRecentUploads() — Checks the connected YouTube account for new uploads, and calls processVideo() on each one.
- getThumbnailDir() — Get the relative thumbnail directory
- saveThumbnailFromUrl()