title: How to check if stream in twitch.tv is on?
body: <p>Here is code of my <code>getStream</code> method:</p>
  
  <pre><code>public static Twitch_Stream getStream(String channelname) {
          try {
              String json = API.readJsonFromUrl("https://api.twitch.tv/kraken/streams?channel=" + channelname);
  
              Twitch_Stream stream = new Twitch_Stream();
              if (json.equalsIgnoreCase("[]")) {
                  stream.setOnline(false);
                  return stream;
              }
  
              JsonArray jb = gson.fromJson(json, JsonArray.class);
              if (jb.size() != 0) {
                  JsonObject jo = (JsonObject) jb.get(0);
                  stream.setOnline(true);
                  stream.load(jo);
              }
  
              return stream;
          } catch (Exception error) {
              error.printStackTrace();
          }
  
          return null;
  
      }
  </code></pre>
  
  <p>and here is code of Twitch_Stream class <a href="http://pastebin.com/3RX1L1cv" rel="nofollow">http://pastebin.com/3RX1L1cv</a></p>
  
  <p>When I make something like this</p>
  
  <pre><code>Twitch_Stream streamer = Twitch_API.getStream("Jankos");
  Bukkit.broadcastMessage("getName " + streamer.getName());
  Bukkit.broadcastMessage(streamer.isOnline() + "");
  </code></pre>
  
  <p><code>streamer.getName()</code> return <code>null</code> and <code>streamer.isOnline()</code> returns <code>false</code>, even when stream is on.</p>
  
  <p>Where did I make a mistake?</p>