jdlrobson / pushipedia

Pushipedia allows you to setup a Node app that watches edits to Wikipedia and ping subscribers when unusual activity occurs.
4 stars 3 forks source link

Pushipedia

Notifications for Wikipedia using Express 4.

Running Locally

Make sure you have Node.js installed.

$ export GCM_API_KEY=<your key>
$ export GCM_SENDER_ID=<your id>
$ export BROADCAST_SECRET=<your secret code>
$ export PUSHIPEDIA_HOST=<e.g. http://localhost:8142/>
$ export PUSHIPEDIA_HTTPS=true
$ cd pushipedia
$ npm install
$ npm start

Your app should now be running on your default port e.g. localhost:5000.

Once subscribed to a notification trigger it with

curl --request POST $PUSHIPEDIA_HOST/api/broadcast -u broadcaster:$BROADCAST_SECRET

Alternatively you can trigger push notifications for an individual feature using:

curl --request POST --data feature=yta $PUSHIPEDIA_HOST/api/broadcast -u broadcaster:$BROADCAST_SECRET

You can use npm forever to keep Pushipedia up and running on a production server.

Configure

$ export PUSHIPEDIA_TRENDING_EDITS_PER_HOUR=5

Deploying to Heroku

If deploying to heroku:

$ heroku create
$ git push heroku master
$ heroku open