<commit_before><?php
class Twitch {
  public $url = '$url = <iframe
                  src="http://player.twitch.tv/?HandIOfIBlood"
                  frameborder="0"
                  scrolling="0"
                  allowfullscreen="1">
                </iframe>';

  private function getFromTwitch() {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://api.twitch.tv/kraken/streams/122441256'); //Set the URL here
    // curl_setopt($curl, CURLOPT_URL, 'https://api.twitch.tv/kraken/streams/49140130'); //Set the URL here
    // curl_setopt($curl, CURLOPT_URL, 'https://api.twitch.tv/kraken/users?login=HandIOfIBlood'); //Set the URL here
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLINFO_HEADER_OUT, true);


    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
      'Accept: application/vnd.twitchtv.v5+json',
      'Client-ID: '.Config::get('twitch/apitoken')
    ));


    $get = curl_exec($curl); //Get the data
    curl_close($curl);
    return $get;
  }

  public function johnStream() {
    $details = json_decode($this->getFromTwitch(), false);

    if($details->stream == null) {
      return false;
    } else {
      return $details;
    }
  }

  public static function link() {

  }

}<commit_msg>Tidying up Twitch class<commit_after><?php
class Twitch {

  private function getFromTwitch() {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://api.twitch.tv/kraken/streams/122441256'); //Set the URL here
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLINFO_HEADER_OUT, true);


    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
      'Accept: application/vnd.twitchtv.v5+json',
      'Client-ID: '.Config::get('twitch/apitoken')
    ));


    $get = curl_exec($curl); //Get the data
    curl_close($curl);
    return $get;
  }

  public function johnStream() {
    $details = json_decode($this->getFromTwitch(), false);

    if($details->stream == null) {
      return false;
    } else {
      return $details;
    }
  }

}
{'fraction_non_alphanumeric': 0.15173764072442486, 'fraction_numerical': 0.015173764072442487, 'mean_word_length': 2.9612403100775193, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6466497', 'n_tokens_mistral': 757, 'n_tokens_neox': 689, 'n_words': 128}