<commit_before>var request = require('request');
var util = require('util');


function GateWatch(login, passwd, url) {
    this.config = {
        login: login,
        passwd: <PASSWORD>,
        url: url || 'https://www.gatewatch.de/api'
    };
}


GateWatch.prototype.makeRequest = function (opt, callback) {
    opt.login = this.config.login;
    opt.password = <PASSWORD>;
    request({url:this.config.url, method:'POST', form:opt},
        function (error, req, body) {
            var data = JSON.parse(body);
            callback(error || data.error, data);
        });
};


GateWatch.prototype.listEvents = function (callback) {
    var opt = {'request_type':'listEvents', 'request_value':''};
    this.makeRequest(opt, callback);
};


GateWatch.prototype.getEvent = function (id, callback) {
    var opt = {'request_type':'getEvent', 'request_value':util.format('{"eventId": %d}', id)};
    this.makeRequest(opt, callback);
};


GateWatch.prototype.getTickets = function (id, callback) {
    var opt = {'request_type':'getTickets', 'request_value':util.format('{"eventId": %d}', id)};
    this.makeRequest(opt, callback);
};


module.exports = GateWatch;<commit_msg>utils-Modul ist unnötig, JSON.stringify() FTW<commit_after>var request = require('request');


function GateWatch(login, passwd, url) {
    this.config = {
        login: login,
        passwd: <PASSWORD>,
        url: url || 'https://www.gatewatch.de/api'
    };
}


GateWatch.prototype.makeRequest = function (opt, callback) {
    opt.login = this.config.login;
    opt.password = <PASSWORD>;
    request({url:this.config.url, method:'POST', form:opt},
        function (error, req, body) {
            var data = JSON.parse(body);
            callback(error || data.error, data);
        });
};


GateWatch.prototype.listEvents = function (callback) {
    var opt = {'request_type':'listEvents', 'request_value':''};
    this.makeRequest(opt, callback);
};


GateWatch.prototype.getEvent = function (id, callback) {
    var opt = {'request_type':'getEvent', 'request_value':JSON.stringify({eventId: id})};
    this.makeRequest(opt, callback);
};


GateWatch.prototype.getTickets = function (id, callback) {
    var opt = {'request_type':'getTickets', 'request_value':JSON.stringify({eventId: id})};
    this.makeRequest(opt, callback);
};


module.exports = GateWatch;
{'fraction_non_alphanumeric': 0.1682282793867121, 'fraction_numerical': 0.0, 'mean_word_length': 3.6699801192842942, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3777946', 'n_tokens_mistral': 744, 'n_tokens_neox': 726, 'n_words': 146}