var request = require("request");

function RantPlugin(bot) {
	var self = this;
	self.name = "rant";
	self.help = "berkin.me rantbox plugin";
	self.depend = ["cmd"];

	self.events = {
		"cmd#rant": function(nick, to, args) {
			request({url: "http://berkin.me/probox/run", method: "POST", form: {nsfw: true, code: args[0]}}, function(err, res, body) {
				if (!err && res.statusCode == 200) {
					var data = JSON.parse(body);
					bot.say(to, nick + ": " + data.result);
				}
			});
		}
	}
}

module.exports = RantPlugin;

@@ -257,11 +257,12 @@
 .me/
-pro
+rant
 box/
@@ -472,16 +472,100 @@
 ;%0A%09%09%09%09%7D%0A
+%09%09%09%09else %7B%0A%09%09%09%09%09bot.out.error(%22rant%22, err);%0A%09%09%09%09%09bot.out.error(%22rant%22, body);%0A%09%09%09%09%7D%0A
 %09%09%09%7D);%0A%09

update API url, error output