3

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?

1
  • If my question is not appropriate for this site, please see my Quora question that led me here: quora.com/… – fresh5447 Aug 23 '15 at 12:59
3

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
1
  • Looking at the API documentation for this site, it looks like none of those methods are really available as-is. So unless the administrators are willing to deal with you and add some sort of notification feature, your best bet will likely be to access their REST API at set intervals and manually check for new data. – moberemk Aug 23 '15 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.