From 7553643e39a16bacfb2ac6563a8558ac475042bc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 15 Nov 2016 17:52:09 -0500 Subject: link to socket workin --- lib/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/index.js') diff --git a/lib/index.js b/lib/index.js index 793581f..a9571f8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -38,3 +38,13 @@ router.post("/_irc/post", function(req, res){ }) res.sendStatus(200) }) + +panda.watch(panda.channels[0], /(https?:\/\/[^\s]+)/g, function(data){ + console.log(data) + data.match.forEach(function(match){ + server.io.emit("link", { + nick: data.nick, + url: match, + }) + }) +}) \ No newline at end of file -- cgit v1.2.3-70-g09d2