\Vigas\StreamingPlatforms\ModelSmashcast

Class Smashcast extends Platform.

Gets data from the Smashcast API

Summary

Methods
Properties
Constants
__construct()
getApiUrl()
getStreamsFromPlatform()
getGamesFromPlatform()
getSearchFromPlatform()
getApiKeys()
getStreams()
getFollowedStreams()
getGames()
getOfflineStreamers()
curlRequest()
getFollowedStreamsFromSmashcast()
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

__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 Smashcast and add them to streams array

Parameters

string $url

Smashcast API url to send the request to

string|null $http_header

Http header to set for the request

Returns

array —

Streams retrieved from Smashcast

getGamesFromPlatform()

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

Gets games from Smashcast and add them to games array

Parameters

string $url

Smashcast API url to send the request to

string|null $http_header

Http header to set for the request

Returns

array —

Games retrieved from Smashcast

getSearchFromPlatform()

getSearchFromPlatform(string  $query) 

Gets search result from Smashcast

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

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

getFollowedStreamsFromSmashcast()

getFollowedStreamsFromSmashcast(string  $username) 

Gets followed streams from Smashcast and add them to streams array

Parameters

string $username

Smashcast username