This repository was archived by the owner on Oct 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.php
More file actions
51 lines (50 loc) · 1.32 KB
/
helper.php
File metadata and controls
51 lines (50 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Helper class for Streaming Now module
*
* @package GuildWars2Brasil.Modules
* @subpackage Modules
* @license GNU/GPL, see LICENSE.php
* mod_helloworld is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
class modStreamingNowHelper
{
/**
* Retrieves the streaming list
*
* @param array $params An object containing the module parameters
* @access public
*/
public static function getStreams( $params )
{
ini_set('default_socket_timeout', 2);
$jsondata = file_get_contents($params->get('url'));
if ($jsondata) {
$json = json_decode($jsondata, true);
return $json['streams'];
} else {
return array();
}
}
/**
* Retrieves the streaming list
*
* @param array $params An object containing the module parameters
* @access public
*/
public static function getMainStreams( $params )
{
ini_set('default_socket_timeout', 2);
$jsondata = file_get_contents($params->get('url_main'));
if ($jsondata) {
$json = json_decode($jsondata, true);
return $json['streams'];
} else {
return array();
}
}
}
?>