@@ -72,23 +72,33 @@ public function apiCall($url, $params = array(), $method = 'get')
72
72
73
73
/**
74
74
* Returns popular current streams
75
+ * @param string $pagination
75
76
* @param int $amount
76
77
* @return string
77
78
*/
78
- public function getTopStreams ($ amount = 25 )
79
+ public function getTopStreams ($ pagination = null , $ amount = 25 )
79
80
{
80
- return $ this ->apiCall ('/helix/streams?amount= ' . rawurlencode ($ amount ));
81
+ if ($ pagination == '' ) {
82
+ return $ this ->apiCall ('/helix/streams?first= ' . rawurlencode ($ amount ) . '' );
83
+ } else {
84
+ return $ this ->apiCall ('/helix/streams?first= ' . rawurlencode ($ amount ) . '&after= ' . rawurlencode ($ pagination ));
85
+ }
81
86
}
82
87
83
88
/**
84
89
* Returns popular current streams for game id
85
90
* @param int $game_id
91
+ * @param string $pagination
86
92
* @param int $amount
87
93
* @return string
88
94
*/
89
- public function getGameTopStreams ($ game_id , $ amount = 25 )
95
+ public function getGameTopStreams ($ game_id , $ pagination = null , $ amount = 25 )
90
96
{
91
- return $ this ->apiCall ('/helix/streams?game_id= ' . rawurlencode ($ game_id ) . '&amount= ' . rawurlencode ($ amount ));
97
+ if ($ pagination == '' ) {
98
+ return $ this ->apiCall ('/helix/streams?game_id= ' . rawurlencode ($ game_id ) . '&first= ' . rawurlencode ($ amount ));
99
+ } else {
100
+ return $ this ->apiCall ('/helix/streams?game_id= ' . rawurlencode ($ game_id ) . '&first= ' . rawurlencode ($ amount ) . '&after= ' . rawurlencode ($ pagination ));
101
+ }
92
102
}
93
103
94
104
/**
@@ -116,14 +126,15 @@ public function getTopViewersForGame()
116
126
/**
117
127
* Returns top games being streamed
118
128
* @param string $pagination
129
+ * @param int $amount
119
130
* @return string
120
131
*/
121
- public function getTopGames ($ pagination = '' )
132
+ public function getTopGames ($ pagination = null , $ amount = 25 )
122
133
{
123
134
if ($ pagination == '' ) {
124
- return $ this ->apiCall ('/helix/games/top?first=25 ' );
135
+ return $ this ->apiCall ('/helix/games/top?first= ' . rawurlencode ( $ amount ) . ' ' );
125
136
} else {
126
- return $ this ->apiCall ('/helix/games/top?first=25 &after= ' . rawurlencode ($ pagination ));
137
+ return $ this ->apiCall ('/helix/games/top?first= ' . rawurlencode ( $ amount ) . ' &after= ' . rawurlencode ($ pagination ));
127
138
}
128
139
}
129
140
0 commit comments