Question

I have created a Slackbot that integrates with Submittable.com. For example, I can trigger a response that displays all current submissions in Slack.

I now need my Slackbot to post in Slack whenever there are any changes or new submissions on Submittable.com.

Do I need to open a web-socket that is always listening to Submittable.com, and is ready to emit events to my node server? What is the best way to do this, without being to harsh on submittables API?

Was it helpful?

Solution

I'm not familiar with the specific site you're integrating with, so this answer is about the general approach to this kind of problem.

The best thing to do in this situation is ask the administrators of the site in question how they want you to do it. Of course, this isn't always possible, so if you can't do this, then the following approaches are in rough order of niceness:

  • use a push notification service supported by the site (it may use such a service to communicate with mobile apps, so check how these work if you can) - this has basically no overhead for the site, so should definitely be the way to do it when you can
  • use a publicly specified websocket api - this is likely to be the next most efficient at the server end because it has the fewest layers of protocol to pass through.
  • use a long polling ajax ("comet") api - this has higher overhead because a new http request is needed for each notification
  • poll an api that returns instantly
  • poll an html page and scrape results from the text
Licensed under: CC-BY-SA with attribution
scroll top