Notifications for Wikipedia using Express 4.
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.
$ export PUSHIPEDIA_TRENDING_EDITS_PER_HOUR=5
If deploying to heroku:
$ heroku create
$ git push heroku master
$ heroku open