Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_GET["id"];
- $follows = $_GET["follows"];
- function url($url) {
- $ch = curl_init();
- $timeout = 5;
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- $data = curl_exec($ch);
- $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return $code;
- }
- if($username == "[username]"){
- exit("Please specify a username");
- }
- if($username == null ){
- exit("Error: Username wrong");
- }
- $answer = url("https://api.twitch.tv/kraken/users/" . $username . "/follows/channels/" . $follows);
- if($answer == 200){
- echo "true";
- }else{
- echo "false";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement