diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-11-15 17:26:44 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-11-15 17:26:44 -0500 |
| commit | 9beaf2708b012b9533ca3088fbddd542a3c6c076 (patch) | |
| tree | 895c29544d96685e3812a92420ea62a8537705a2 /lib/index.js | |
| parent | 468c23aae285e8845a16e4df527d37db9fef420b (diff) | |
dumping color codes to irc
Diffstat (limited to 'lib/index.js')
| -rw-r--r-- | lib/index.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/index.js b/lib/index.js index 7883c3f..6ec87a2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,6 +14,7 @@ var storage = multer.memoryStorage() var multer_upload = multer({ storage: storage }) var upload = require("./upload") + router.post("/_irc/image", multer_upload.single('image'), function(req, res){ upload.put("image", req.file, { unacceptable: function(err){ @@ -26,9 +27,15 @@ router.post("/_irc/image", multer_upload.single('image'), function(req, res){ }) router.get("/_irc/links", function(req, res){ -// panda.query("links", function(links){ -// res.json( plinko.parse_links(links) ) -// }) - links = ["\u00033,1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx links for 11/15/2016","\u00033<\u00033noisia\u00033>\u000315 http://imgur.com/9uoPXyL","\u00033<\u00033noisia\u00033>\u000315 https://usercontent.irccloud-cdn.com/file/CY0a0Fmw/Screen%20Shot%202016-11-14%20at%206.33.29%20PM.png","\u00033<\u00037ffog\u00033>\u000315 http://www.cmgreport.com/breaking-news-george-soros-has-died-possible-heart-attack/","\u00033<\u000311noth\u00033>\u000315 https://www.youtube.com/watch?v=JJXspT2VtOE","\u00033<\u000311noth\u00033>\u000315 https://www.youtube.com/watch?v=Zj5v5bO0K4I","\u00033<\u00030fanfare\u00033>\u000315 https://twitter.com/kincannon_show/status/798264132055302144","\u00033<\u00030thorns\u00033>\u000315 http://jollo.org/LNT/public/cQcOoZqY.html","\u00033,1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx type: menu"] - res.json( plinko.parse_links(links) ) + panda.query("plinko", "links", function(links){ + res.json( plinko.parse_links(links) ) + }) +}) + +router.post("/_irc/post", require('body-parser').urlencoded({ extended: false }), function(req, res){ + var lines = req.body.image.split("\n") + lines.forEach(function(line){ + panda.say(panda.channels[0], line) + }) + res.sendStatus(200) }) |
