Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function sub_length($access_token, $channel, $target) {
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array(
- 'Authorization: OAuth '.$access_token
- ));
- curl_setopt($curl, CURLOPT_URL, $this->base_url.'channels/' . $channel . '/subscriptions/' . $target);
- $output = curl_exec($curl);
- $response = json_decode($output, true);
- curl_close($curl);
- if(isset($response['error'])) {
- $error = 'Unauthorized';
- return $error;
- } else {
- $total = $response['created_at'];
- return $total;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement