Cool, I took a look at the data in api/recent and realized that there's no info about the content of the topic except the title... Is there any way I can get post content?
Webhooks for new topic/reply notification
-
I wondering if possible to develop an official webhook features for new topic/reply notification, where user can enter an URL to send the topic name and other info
-
Did you mean a "write-enabled" API? It's possible, just hasn't been done yet... just one of many things I'd like to do with NodeBB
... in case @baris or @psychobunny plan to steal this away from me: I was going to do it as a plugin, and inject routes into app (during app.load)... then other plugins could also list this plugin as a peer dep and add their own routes... *pipe dreams*
-
Hi, what I meant is that where user enter an external URL
like
http://<my domain>/notify/topic
then select event- new topic
- new reply
then NodeBB will calling this URL via HTTP GET/POST with parameters like topicname,date,author....
-
@julian said:
PI? It's possible, just hasn't been done yet... just one of many things I'd like to do with NodeBB
I have a community chatting on slack (http://www.slack.com), it will be interesting if I can use web hooks to integrate both system together.
-
Sure this is totally possible in a few lines of code.
Look here for full list of hooks: https://docs.nodebb.org/en/latest/plugins/hooks.html
Look for the hooks
action:post.save
andaction:topic.save
, in your plugin use the request module to make an API call to whatever API you want, in this case the Slack API with your creds.EDIT: If you make a plugin out of this, don't forget to release it
Slack looks really cool.
-
I just posted a plugin to do just that: nodebb-plugin-slack
Available from npm or direct https://github.com/nhitchins/nodebb-plugin-slack -
[edit]
Sorry, working now. Need to restart NodeBB once the settings is saved.
-
@nhitchins said:
I just posted a plugin to do just that: nodebb-plugin-slack
Available from npm or direct https://github.com/nhitchins/nodebb-plugin-slackI saw this on Google! It sounds awesome
Did you post it in the plugins forum?
-
Mind if i request some enhancements to this plugin?
- Monitoring of Posts of certain categories, and notify specific channels in slack.
- Monitoring of New User Registrations and notify specific channels in slack.
-
nodebb-plugin-slack installed in NodeBB v0.6.0. after activation we need to reload the NodeBB. Facing Error while reloading the NodeBB.
Error Message :
22/1 11:20 [21130] - error: TypeError: Cannot read property 'buildHeader' of undefined
at Object.Slack.init [as method] (/home/ubuntu/Nodebb/nodebb/NodeBB/NodeBB-NodeBB-2a92c11/node_modules/nodebb-plugin-slack/library.js:40:57)Kindly help us to fix this issue.
-
Sounds like you're using the wrong version of either nodebb or the plugin. Can you confirm both your versions of nodebb and the plug in.
-
Yep, looks as though the slack plugin is incompatible with NodeBB v0.6.0. Perhaps you could contact @nhitchins ?
-
@nhitchins I have installed the npm module (nodebb-plugin-slack). I'm using NodeBB v0.6.0.
Once module is installed and activated, tried to reload the NodeBB. We are facing error while reloading the nodebb.Error Message -
Error Message :22/1 11:20 [21130] - error: TypeError: Cannot read property 'buildHeader' of undefined
at Object.Slack.init [as method] (/home/ubuntu/Nodebb/nodebb/NodeBB/NodeBB-NodeBB-2a92c11/node_modules/nodebb-plugin-slack/library.js:40:57)Kindly help us to fix this issue.
-
-
@yariplus said:
I need to install slack plugin. Above mentioned command will remove the plugin right? -
@Prasanna-Prachu yes, that will remove it so you can use your page until the 0.6.0 version is ready.
-
@yariplus ok ok ... Now i removed the plugin. Kindly update once the plugin is ready for NodeBB v0.6.0
-
@Prasanna-Prachu I am not sure when this plugin will be updated but you can modify the library.js file of the plugin a little bit to make the plugin work.
Replace lines 35 - 41 from library.js with these
Slack.init = function(app, callback) { function render(req, res, next) { res.render('admin/plugins/slack', {}); } app.router.get('/admin/plugins/slack', app.middleware.admin.buildHeader, render); app.router.get('/api/admin/plugins/slack', render);
-
@Prasanna-Prachu plugin is now updated to work with v0.6.0
-
@pichalite Slack module is installed. Kindly guide me how to configure the Slack into NodeBB. Im using mailgun for sending mail. How to integrate mailgun and slack so that email need to trigger any new direct messages or mentions of your name.