statox / stackexchange-watcher

Watch new questions on stackexchange sites and get a slack notification for new questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StackExchange-watcher

Watch the sites of the stackexchange network and get a slack notification for new questions

Why?

Because if you are like me, you like to contribute to StackExchanges sites which don't have a lot of traffic. And you don't want to check the new question page every ten minutes.

So you can simply run this code on your local machine or in a cloud function and get a nice Slack notification with the link to the questions you didn't already see.

How?

Configuration

The file config.json contains all the keys you need to run the application:

  • slack.webhookurl Always keep it private The URL generated by slack to reach your team. See their doc. here
  • slack.channel The channel which should get the notification of the new question. You can specify either a #channel or a @user
  • slack.username The screenname of the bot when it sends you a notification
  • persitence.idfilepath The path to the file where the application will write the ID of the last seen question
  • stackexchange.sites A JSON array of the sites you want to follow
  • stackexchange.refresh The refresh rate of the app in seconds

Running the app

First clone this repo, then use npm to install the dependencies:

npm install

You're ready to go, simply start the app with:

npm start

What's under the hood?

Roadmap

  • Use the StackExchange API to get the new questions instead of parsing the HTML
  • Watch the review queues
  • Support several slack users to have one instance for several users in the same slack team
  • Get rid of the id file to prepare the deployment as cloud function
  • Make deployable in cloud function out of the box

About

Watch new questions on stackexchange sites and get a slack notification for new questions

License:MIT License


Languages

Language:JavaScript 100.0%