\Vigas\StreamingPlatforms\ModelPlatform

Abstract Class Platform.

Gets data from a streaming platform API

Summary

Methods
Properties
Constants
curlRequest()
__construct()
getApiUrl()
getStreamsFromPlatform()
getGamesFromPlatform()
getSearchFromPlatform()
getApiKeys()
getStreams()
getFollowedStreams()
getGames()
getOfflineStreamers()
No public properties found
No constants found
No protected methods found
$api_keys
$streams
$followed_streams
$games
$offline_streamers
N/A
No private methods found
No private properties found
N/A

Properties

$api_keys

$api_keys : array

Type

array — A platform's API keys

$streams

$streams : array

Type

array — Contains streams retrieved from the streaming platform

$followed_streams

$followed_streams : array

Type

array — Contains followed streams retrieved from the streaming platform

$games

$games : array

Type

array — Contains games retrieved from the streaming platform

$offline_streamers

$offline_streamers : array

Type

array — Contains offline streamers name retrieved from the streaming platform

Methods

curlRequest()

curlRequest(string  $url, string|null  $post_data = null, string|null  $http_header = null) : string

Parameters

string $url

URL to send the request to

string|null $post_data

POST data to send

string|null $http_header

HTTP header to set

Returns

string —

Returns http(s) response

__construct()

__construct() 

Sets the streaming platform API keys

getApiUrl()

getApiUrl(string  $tagname, array  $vars = null) 

Sets the streaming platform API URL

Parameters

string $tagname

The XML tag name attribute

array $vars

Variables to replace in the API URL

getStreamsFromPlatform()

getStreamsFromPlatform(string  $url, string|null  $http_header = null) : array

Gets streams from the streaming platform

Parameters

string $url

Platform API url to send the request to

string|null $http_header

Http header to set for the request

Returns

array —

Streams retrieved from the platform

getGamesFromPlatform()

getGamesFromPlatform(string  $url, string|null  $http_header = null) : array

Gets games from the streaming platform

Parameters

string $url

Platform API url to send the request to

string|null $http_header

Http header to set for the request

Returns

array —

Games retrieved from the platform

getSearchFromPlatform()

getSearchFromPlatform(string  $query) 

Gets search from the streaming platform

Parameters

string $query

Research's keyword(s) entered by the user

getApiKeys()

getApiKeys() : array

Returns

array —

A platform's API keys

getStreams()

getStreams() : array

Returns

array —

Contains streams retrieved from the streaming platform

getFollowedStreams()

getFollowedStreams() : array

Returns

array —

Contains followed streams retrieved from the streaming platform

getGames()

getGames() : array

Returns

array —

Contains games retrieved from the streaming platform

getOfflineStreamers()

getOfflineStreamers() : array

Returns

array —

Contains offline streamers name retrieved from the streaming platform