From a074779441b38b15bfd85a0978603d6fe0add0f0 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 13:55:35 +0000 Subject: [PATCH 01/14] add basic --- modules/rc/config.json | 3 +++ modules/rc/rc.js | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 modules/rc/config.json create mode 100644 modules/rc/rc.js diff --git a/modules/rc/config.json b/modules/rc/config.json new file mode 100644 index 0000000..4e47107 --- /dev/null +++ b/modules/rc/config.json @@ -0,0 +1,3 @@ +{ + "port":1337 +} diff --git a/modules/rc/rc.js b/modules/rc/rc.js new file mode 100644 index 0000000..d25a99d --- /dev/null +++ b/modules/rc/rc.js @@ -0,0 +1,27 @@ +/** + * Module Name: Link + * Description: Stores recent channel rcs, with commands to retrieve + * information about rcs. + */ +var dgram = require('dgram'); + +var rc = function(dbot) { + var server = dgram.createSocket("udp4"); + + server.on("message", function(msg, rinfo) { + console.log(msg.toString()); + }); + + server.bind(dbot.config.rc.port); + + + var commands = { + }; + this.commands = commands; + + this.on = 'PRIVMSG'; +}; + +exports.fetch = function(dbot) { + return new rc(dbot); +}; From 8eb60552fbd63859de1b94c77343367d7b518ada Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 14:17:24 +0000 Subject: [PATCH 02/14] tidy --- modules/rc/rc.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/rc/rc.js b/modules/rc/rc.js index d25a99d..1b57ed0 100644 --- a/modules/rc/rc.js +++ b/modules/rc/rc.js @@ -1,7 +1,7 @@ /** - * Module Name: Link - * Description: Stores recent channel rcs, with commands to retrieve - * information about rcs. + * Module Name: RC + * Description: Relays UDP packets, intended for + * a feed of RecentChanges on a MediaWiki install. */ var dgram = require('dgram'); @@ -9,17 +9,12 @@ var rc = function(dbot) { var server = dgram.createSocket("udp4"); server.on("message", function(msg, rinfo) { + var message = msg.toString(); console.log(msg.toString()); + // dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); }); server.bind(dbot.config.rc.port); - - - var commands = { - }; - this.commands = commands; - - this.on = 'PRIVMSG'; }; exports.fetch = function(dbot) { From 1082ea65d4518b150b7c818f16db60cd4ab2be0d Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 14:18:43 +0000 Subject: [PATCH 03/14] actually tidy --- modules/rc/rc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rc/rc.js b/modules/rc/rc.js index 1b57ed0..7a767f6 100644 --- a/modules/rc/rc.js +++ b/modules/rc/rc.js @@ -10,7 +10,7 @@ var rc = function(dbot) { server.on("message", function(msg, rinfo) { var message = msg.toString(); - console.log(msg.toString()); + console.log(message); // dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); }); From 184d70d3a7cd1e09dc7fd6720210e770b1ebaf62 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 16:34:59 +0000 Subject: [PATCH 04/14] add shizzle --- modules/rc/README.md | 12 ++++++++++++ modules/rc/config.json | 5 ++++- modules/rc/rc.js | 8 ++++---- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 modules/rc/README.md diff --git a/modules/rc/README.md b/modules/rc/README.md new file mode 100644 index 0000000..b3d5e3b --- /dev/null +++ b/modules/rc/README.md @@ -0,0 +1,12 @@ +# RC +Prints UDP packets; designed for a MediaWiki installation. + +# Configuration +## server +The server name, as configured in the main ``config.json``, that depressionbot will announce packets from. +## channel +The channel name, that depressionbot will announce packets from. +## port +The port depressionbot will listen for UDP packets on. +## address +The address depressionbot will allow UDP packets from. UDP packets sent from a different address will be ignored. diff --git a/modules/rc/config.json b/modules/rc/config.json index 4e47107..b1ba13a 100644 --- a/modules/rc/config.json +++ b/modules/rc/config.json @@ -1,3 +1,6 @@ { - "port":1337 + "port":14628, + "address": "127.0.0.1", + "server": "freenode", + "channel": "#zuzak2" } diff --git a/modules/rc/rc.js b/modules/rc/rc.js index 7a767f6..c494636 100644 --- a/modules/rc/rc.js +++ b/modules/rc/rc.js @@ -7,13 +7,13 @@ var dgram = require('dgram'); var rc = function(dbot) { var server = dgram.createSocket("udp4"); - - server.on("message", function(msg, rinfo) { + server.on("message", function(msg, msginfo) { var message = msg.toString(); console.log(message); - // dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); + if (msginfo.address == dbot.config.rc.address) { + dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); + } }); - server.bind(dbot.config.rc.port); }; From c26c52a33f9731dd65b8e27738d5745f5eb05d41 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 16:52:24 +0000 Subject: [PATCH 05/14] tweak grammar of README --- modules/rc/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rc/README.md b/modules/rc/README.md index b3d5e3b..57ba5ae 100644 --- a/modules/rc/README.md +++ b/modules/rc/README.md @@ -3,9 +3,9 @@ Prints UDP packets; designed for a MediaWiki installation. # Configuration ## server -The server name, as configured in the main ``config.json``, that depressionbot will announce packets from. +The server name, as configured in the main ``config.json``, that depressionbot will announce packets on. ## channel -The channel name, that depressionbot will announce packets from. +The channel name, that depressionbot will announce packets on. ## port The port depressionbot will listen for UDP packets on. ## address From 8404cb42458a9662dd4244c90d8c567624e3a69a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 6 Mar 2013 17:48:48 +0000 Subject: [PATCH 06/14] genericise --- modules/{rc => udp}/README.md | 4 ++-- modules/{rc => udp}/config.json | 2 +- modules/{rc/rc.js => udp/udp.js} | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) rename modules/{rc => udp}/README.md (76%) rename modules/{rc => udp}/config.json (74%) rename modules/{rc/rc.js => udp/udp.js} (58%) diff --git a/modules/rc/README.md b/modules/udp/README.md similarity index 76% rename from modules/rc/README.md rename to modules/udp/README.md index 57ba5ae..1c2b284 100644 --- a/modules/rc/README.md +++ b/modules/udp/README.md @@ -1,5 +1,5 @@ -# RC -Prints UDP packets; designed for a MediaWiki installation. +# UDP +Prints UDP packets; designed for a [MediaWiki installation](https://www.mediawiki.org/wiki/Manual:$wgRC2UDPAddress). # Configuration ## server diff --git a/modules/rc/config.json b/modules/udp/config.json similarity index 74% rename from modules/rc/config.json rename to modules/udp/config.json index b1ba13a..4619fcd 100644 --- a/modules/rc/config.json +++ b/modules/udp/config.json @@ -2,5 +2,5 @@ "port":14628, "address": "127.0.0.1", "server": "freenode", - "channel": "#zuzak2" + "channel": "#oaosidl" } diff --git a/modules/rc/rc.js b/modules/udp/udp.js similarity index 58% rename from modules/rc/rc.js rename to modules/udp/udp.js index c494636..b7d9b76 100644 --- a/modules/rc/rc.js +++ b/modules/udp/udp.js @@ -1,22 +1,22 @@ /** - * Module Name: RC + * Module Name: UDP * Description: Relays UDP packets, intended for * a feed of RecentChanges on a MediaWiki install. */ var dgram = require('dgram'); -var rc = function(dbot) { +var udp = function(dbot) { var server = dgram.createSocket("udp4"); server.on("message", function(msg, msginfo) { var message = msg.toString(); console.log(message); - if (msginfo.address == dbot.config.rc.address) { - dbot.say(dbot.config.rc.server, dbot.config.rc.channel, message); + if (msginfo.address == dbot.config.udp.address) { + dbot.say(dbot.config.udp.server, dbot.config.udp.channel, message); } }); - server.bind(dbot.config.rc.port); + server.bind(dbot.config.udp.port); }; exports.fetch = function(dbot) { - return new rc(dbot); + return new udp(dbot); }; From e59e4c343fe1b1bc06d804c3ceb2a0b84cd8461a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 1 May 2013 09:42:42 +0000 Subject: [PATCH 07/14] Add basic hashing functionality to imgur * There is probably a much nicer way of doing it (perhaps a better hash)? * Added a counter to the imgur random page counting the number of [Facebook Monopoly Men](http://i.imgur.com/3Tt6N.gif). * Added the md5sum of the current image to the getRandomImage api call. * Future functionality might be storing every image md5 in an array and counting duplicates, instead of the current check-against-known-dupes. --- modules/imgur/imgur.js | 6 ++-- public/imgurr.css | 12 ++++++++ views/imgur/imgurr.jade | 64 +++-------------------------------------- 3 files changed, 20 insertions(+), 62 deletions(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 507e6f2..b412d4c 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -4,7 +4,8 @@ */ var _ = require('underscore')._, - request = require('request'); + request = require('request'), + crypto = require('crypto'); var imgur = function(dbot) { this.db = dbot.db.imgur; @@ -50,7 +51,8 @@ var imgur = function(dbot) { // 492 is body.length of a removed image if(!error && response.statusCode == 200 && body.length != 492) { this.db.totalImages += 1; - callback(testUrl, testSlug); + var hash = crypto.createHash('md5').update(body).digest("hex"); + callback(testUrl, testSlug,hash); } else { this.api.getRandomImage(callback); } diff --git a/public/imgurr.css b/public/imgurr.css index f2bbb11..37d6fc7 100644 --- a/public/imgurr.css +++ b/public/imgurr.css @@ -106,3 +106,15 @@ html,body { overflow:auto; padding:0; } +#count2 { + bottom:25px; + position:absolute; + border-radius:5px; + display:none; + margin;5px; + padding:5px; + right:25px; + background-color:#3b5998; + color:white; + font-family:'Freight Sans Bold','Lucida Grande',verdana,arial,sans-serif; +} diff --git a/views/imgur/imgurr.jade b/views/imgur/imgurr.jade index b3e4436..41d27fe 100644 --- a/views/imgur/imgurr.jade +++ b/views/imgur/imgurr.jade @@ -3,73 +3,17 @@ html(lang='en') head meta(charset='utf-8') script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js") + script(type="text/javascript", src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js") + script(type="text/javascript", src="/imgurr.js") link(rel="stylesheet", href="/imgurr.css") title random imgur - script - var count = 0; - function giveMessage(msg) { - $('
  • '+msg+'
  • ').prependTo('#history').hide().slideDown(); - } - var lock = false - var highscore = #{highscore} + 1; - var score = highscore; - $('#count').text(score); - function getNewImage() { - count += 1; - lock = true; - $('#loading').fadeIn(); - $('#loading').text('Loading image ' + count + '...'); - document.title = 'random imgur (' + count + ')'; - $('#loading').fadeIn(); - $('#image').load(function(){}); - $.get("/api/imgur/getRandomImage", function(d) { - $('#image').attr('src', d.data[0]); - lock = false; - score -= 1; - $('#count').text(score); - $('#details').text("Fetching info..."); - giveMessage('' + d.data[0] + ''); - $.get("/api/imgur/getImageInfoString", { 'slug': d.data[1] }, function(info) { - if(info.data[0].indexOf('undefined') == -1) { - $("#details").text(count + ': ' + info.data[0]); - $('#details').show(); - } else { - $("#details").hide(); - } - $('#loading').fadeOut(); - }, "json"); - }, "json"); - } - $(getNewImage()); - $(document).on('keydown', function(e){ - switch(e.which){ - case 82: // r - score = highscore; - $('#count').text(highscore); - giveMessage("Score reset."); - case 13: // enter - case 32: // space - if (lock) { - $('#loading').text(function(index, text){ - return text.replace(/\.(?=[^.]*$)/, "!"); - }); - } else { - getNewImage(); - } - break; - case 67: - $('#count').fadeToggle(); - break; - case 83: // s - $('body').toggleClass('crop'); - giveMessage("Toggled scrollbars.") - }; - }); body div#loading Loading image 1... div#details Press [SPACE] to load a new image div#count #{highscore} + div#count2 + ø ul#history li Press [SPACE] for next div#container From 143df9ddca988a415fae2b9902f9cfec6fdecd8a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 1 May 2013 11:48:00 +0000 Subject: [PATCH 08/14] Update imgurr.jade --- views/imgur/imgurr.jade | 1 - 1 file changed, 1 deletion(-) diff --git a/views/imgur/imgurr.jade b/views/imgur/imgurr.jade index 41d27fe..35d05ba 100644 --- a/views/imgur/imgurr.jade +++ b/views/imgur/imgurr.jade @@ -3,7 +3,6 @@ html(lang='en') head meta(charset='utf-8') script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js") - script(type="text/javascript", src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js") script(type="text/javascript", src="/imgurr.js") link(rel="stylesheet", href="/imgurr.css") title random imgur From 7578382bee147929b55f695727e02f9473422e0d Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 1 May 2013 09:42:42 +0000 Subject: [PATCH 09/14] Add basic hashing functionality to imgur * There is probably a much nicer way of doing it (perhaps a better hash)? * Added a counter to the imgur random page counting the number of [Facebook Monopoly Men](http://i.imgur.com/3Tt6N.gif). * Added the md5sum of the current image to the getRandomImage api call. * Future functionality might be storing every image md5 in an array and counting duplicates, instead of the current check-against-known-dupes. --- modules/imgur/imgur.js | 6 ++-- public/imgurr.css | 12 +++++++ public/imgurr.js | 76 +++++++++++++++++++++++++++++++++++++++++ views/imgur/imgurr.jade | 64 +++------------------------------- 4 files changed, 96 insertions(+), 62 deletions(-) create mode 100644 public/imgurr.js diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 507e6f2..b412d4c 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -4,7 +4,8 @@ */ var _ = require('underscore')._, - request = require('request'); + request = require('request'), + crypto = require('crypto'); var imgur = function(dbot) { this.db = dbot.db.imgur; @@ -50,7 +51,8 @@ var imgur = function(dbot) { // 492 is body.length of a removed image if(!error && response.statusCode == 200 && body.length != 492) { this.db.totalImages += 1; - callback(testUrl, testSlug); + var hash = crypto.createHash('md5').update(body).digest("hex"); + callback(testUrl, testSlug,hash); } else { this.api.getRandomImage(callback); } diff --git a/public/imgurr.css b/public/imgurr.css index f2bbb11..37d6fc7 100644 --- a/public/imgurr.css +++ b/public/imgurr.css @@ -106,3 +106,15 @@ html,body { overflow:auto; padding:0; } +#count2 { + bottom:25px; + position:absolute; + border-radius:5px; + display:none; + margin;5px; + padding:5px; + right:25px; + background-color:#3b5998; + color:white; + font-family:'Freight Sans Bold','Lucida Grande',verdana,arial,sans-serif; +} diff --git a/public/imgurr.js b/public/imgurr.js new file mode 100644 index 0000000..5c03f60 --- /dev/null +++ b/public/imgurr.js @@ -0,0 +1,76 @@ +function giveMessage(msg) { + $('
  • '+msg+'
  • ').prependTo('#history').hide().slideDown(); +} + +var lock = false; +var highscore = 10 + 1; +var score = highscore; +var count = 0; +var count2 = 0; + +$('#count').text(score); + +function getNewImage() { + count += 1; + lock = true; + $('#loading').fadeIn(); + $('#loading').text('Loading image ' + count + '...'); + document.title = 'random imgur (' + count + ')'; + $('#loading').fadeIn(); + $('#image').load(function(){}); + $.get("/api/imgur/getRandomImage", function(d) { + $('#image').attr('src', d.data[0]); + lock = false; + score -= 1; + $('#count').text(score); + $('#details').text("Fetching info..."); + giveMessage('' + d.data[0] + ''); + $.get("/api/imgur/getImageInfoString", { 'slug': d.data[1] }, function(info) { + if(info.data[0].indexOf('undefined') == -1) { + $("#details").text(count + ': ' + info.data[0]); + $('#details').show(); + } else { + $("#details").hide(); + } + $('#loading').fadeOut(); + }, "json"); + console.log(d.data[2]); + if(d.data[2] == "e49e686582ce3f60cb51d00c10924861") { // 3Tt6N fb guy + count2 += 1; + if (count2 == 1){ + $('#count2').text("+ " + count2 + " Facebook Monopoly Man"); + } else { + $('#count2').text("+ " + count2 + " Facebook Monopoly Men"); + } + $('#count2').fadeIn(); + } + }, "json"); +} + +$(getNewImage()); + +$(document).on('keydown', function(e){ + switch(e.which){ + case 82: // r + score = highscore; + $('#count').text(highscore); + giveMessage("Score reset."); + case 13: // enter + case 32: // space + if (lock) { + $('#loading').text(function(index, text){ + return text.replace(/.(?=[^.]*$)/, "!"); + }); + } else { + getNewImage(); + } + break; + case 67: + $('#count').fadeToggle(); + $('#count2').fadeToggle(); + break; + case 83: // s + $('body').toggleClass('crop'); + giveMessage("Toggled scrollbars.") + }; +}); diff --git a/views/imgur/imgurr.jade b/views/imgur/imgurr.jade index b3e4436..41d27fe 100644 --- a/views/imgur/imgurr.jade +++ b/views/imgur/imgurr.jade @@ -3,73 +3,17 @@ html(lang='en') head meta(charset='utf-8') script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js") + script(type="text/javascript", src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js") + script(type="text/javascript", src="/imgurr.js") link(rel="stylesheet", href="/imgurr.css") title random imgur - script - var count = 0; - function giveMessage(msg) { - $('
  • '+msg+'
  • ').prependTo('#history').hide().slideDown(); - } - var lock = false - var highscore = #{highscore} + 1; - var score = highscore; - $('#count').text(score); - function getNewImage() { - count += 1; - lock = true; - $('#loading').fadeIn(); - $('#loading').text('Loading image ' + count + '...'); - document.title = 'random imgur (' + count + ')'; - $('#loading').fadeIn(); - $('#image').load(function(){}); - $.get("/api/imgur/getRandomImage", function(d) { - $('#image').attr('src', d.data[0]); - lock = false; - score -= 1; - $('#count').text(score); - $('#details').text("Fetching info..."); - giveMessage('' + d.data[0] + ''); - $.get("/api/imgur/getImageInfoString", { 'slug': d.data[1] }, function(info) { - if(info.data[0].indexOf('undefined') == -1) { - $("#details").text(count + ': ' + info.data[0]); - $('#details').show(); - } else { - $("#details").hide(); - } - $('#loading').fadeOut(); - }, "json"); - }, "json"); - } - $(getNewImage()); - $(document).on('keydown', function(e){ - switch(e.which){ - case 82: // r - score = highscore; - $('#count').text(highscore); - giveMessage("Score reset."); - case 13: // enter - case 32: // space - if (lock) { - $('#loading').text(function(index, text){ - return text.replace(/\.(?=[^.]*$)/, "!"); - }); - } else { - getNewImage(); - } - break; - case 67: - $('#count').fadeToggle(); - break; - case 83: // s - $('body').toggleClass('crop'); - giveMessage("Toggled scrollbars.") - }; - }); body div#loading Loading image 1... div#details Press [SPACE] to load a new image div#count #{highscore} + div#count2 + ø ul#history li Press [SPACE] for next div#container From 086d4be6ab4e3732af6be15a96480f54e866bb08 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 17 May 2013 13:58:44 +0000 Subject: [PATCH 10/14] i think adding a this.pages breaks it --- modules/api/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/api/api.js b/modules/api/api.js index 408dc0a..dc4fedd 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -5,7 +5,7 @@ var _ = require('underscore')._; var api = function(dbot) { - this.pages = { + /*this.pages = { '/api': function(req, res) { var externalApi = {}; _.each(dbot.api, function(moduleApi, moduleName) { @@ -19,7 +19,7 @@ var api = function(dbot) { res.render('api', { 'name': dbot.config.name, 'api': externalApi }); } - }; + };*/ this.onLoad = function() { dbot.modules.web.app.get('/api/:module/:method', function(req, res) { From 1127d11a0e6091ebe1a54b61e337b84f203951ed Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 17 May 2013 14:10:43 +0000 Subject: [PATCH 11/14] undo thing --- modules/api/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/api/api.js b/modules/api/api.js index dc4fedd..408dc0a 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -5,7 +5,7 @@ var _ = require('underscore')._; var api = function(dbot) { - /*this.pages = { + this.pages = { '/api': function(req, res) { var externalApi = {}; _.each(dbot.api, function(moduleApi, moduleName) { @@ -19,7 +19,7 @@ var api = function(dbot) { res.render('api', { 'name': dbot.config.name, 'api': externalApi }); } - };*/ + }; this.onLoad = function() { dbot.modules.web.app.get('/api/:module/:method', function(req, res) { From 5da4d88ad9311dd5755a4c2951e1ffc7aa13ce83 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 17 May 2013 14:13:42 +0000 Subject: [PATCH 12/14] api root in onLoad --- modules/api/api.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/api/api.js b/modules/api/api.js index 408dc0a..e05fe18 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -5,8 +5,8 @@ var _ = require('underscore')._; var api = function(dbot) { - this.pages = { - '/api': function(req, res) { + this.onLoad = function() { + dbot.modules.web.app.get('/api': function(req, res) { var externalApi = {}; _.each(dbot.api, function(moduleApi, moduleName) { externalApi[moduleName] = {}; @@ -18,10 +18,8 @@ var api = function(dbot) { }); res.render('api', { 'name': dbot.config.name, 'api': externalApi }); - } - }; + }); - this.onLoad = function() { dbot.modules.web.app.get('/api/:module/:method', function(req, res) { var module = req.params.module, method = req.params.method, From 0a8ad1e468758c8a1ccd00451214ddf12fb57a47 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 17 May 2013 14:15:15 +0000 Subject: [PATCH 13/14] syntax error --- modules/api/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/api/api.js b/modules/api/api.js index e05fe18..c339f22 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -6,7 +6,7 @@ var _ = require('underscore')._; var api = function(dbot) { this.onLoad = function() { - dbot.modules.web.app.get('/api': function(req, res) { + dbot.modules.web.app.get('/api', function(req, res) { var externalApi = {}; _.each(dbot.api, function(moduleApi, moduleName) { externalApi[moduleName] = {}; From 1e01aeb146e839c9e59aa2d5ddbb80f679d2ba20 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 17 May 2013 14:15:59 +0000 Subject: [PATCH 14/14] load the right route api --- modules/api/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/api/api.js b/modules/api/api.js index c339f22..88ed709 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -17,7 +17,7 @@ var api = function(dbot) { }); }); - res.render('api', { 'name': dbot.config.name, 'api': externalApi }); + res.render('api/api', { 'name': dbot.config.name, 'api': externalApi }); }); dbot.modules.web.app.get('/api/:module/:method', function(req, res) {