/**
 * Created by Leavzou on 31/10/2014.
 */

@@ -3,43 +3,1989 @@
 *%0A *
- Created by Leavzou on 31/10/2014.%0A */%0A
+%0A * Copyright (C) %3C2014%3E %3CMaxime Bouchenoire%3E%0A *%0A * Permission to use, copy, modify, and/or distribute this software for any%0A * purpose with or without fee is hereby granted, provided that the above%0A * copyright notice and this permission notice appear in all copies.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22 AND THE AUTHOR DISCLAIMS ALL WARRANTIES%0A * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF%0A * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR%0A * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES%0A * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION%0A * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN%0A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.%0A *%0A */%0A%0Avar http = require('request');%0A%0ATWITCH_API = 'https://api.twitch.tv/kraken/';%0A%0Afunction Twitch() %7B%0A    // do nothing%0A%7D%0A%0A/**%0A * Returns a list of 'stream' resource based on this documentation:%0A * https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md%0A *%0A * @param args args.number (optional): number of streams to retrieve%0A *             args.offset (optional): offset from which you want to start to get the streams list%0A * @param callback called when the streams have been retrieved, with streams as only argument%0A * @returns %7Bboolean%7D false if arguments are missing%0A */%0ATwitch.prototype.streams = function(args, callback) %7B%0A    if (typeof args == 'function') callback = args;%0A    if (!callback %7C%7C typeof callback != 'function') return false;%0A%0A    var number = args.number %7C%7C 100;%0A    var offset = args.offset %7C%7C 0;%0A%0A    http.get(%7B%0A        url: TWITCH_API + 'streams?number=' + number + '&offset=' + offset%0A    %7D, function(err, response, body) %7B%0A        if (err) %7B%0A            console.log(err);%0A        %7D else %7B%0A            body = JSON.parse(body);%0A            var streams = body.streams;%0A            if (callback) callback(streams);%0A        %7D%0A    %7D)%0A%7D%0A%0Amodule.exports = Twitch;

add license to file header