Parsely slackbot is a slack custom integration that uses the Parsely API to allow realtime Slackalytics in your Slack instance.
Parsely slackbot is an open-source slack custom integration that uses the Parsely API to allow realtime Slackalytics in your Slack instance!
Server Set Up
You’ll need to run the slackbot on a server.
` pip install parsely-slackbot `
and then, to start the server, run:
` parsely_slackbot `
The bot will generate a sample config.yaml for you. See a sample here. Edit with your Site ID and API shared secret for the account you want to show in the channel. You can find these here. You will need the Slack team ID from your channel and the Slack token from the set up below. You should then deploy the app on your own domain or using a service like Heroku, saving the deployment URL for use in the Slack setup process described below.
Slack Channel Set Up
In your channel settings, select “Customize Slack.” Choose “Configure Apps” –> “Custom Integrations”
Add a “Slash Commands” integration
In the “command” section, enter the slash_command value from the config (the default is parsely).
In the “URL” field, enter the URL your slackbot will be running on, created in the Server Set Up step. Make sure to specify the port in the style of http://EXAMPLE.com:6000. (The default port is 6000 for the slackbot)
The rest of the fields can be left as their defaults. You can also upload the Parse.ly logo.
Note: The lightweight server shipped with Flask has worked quite well in testing for small and mid-sized teams. For larger teams (and as a best practice in general), you might want to look into a more robust WSGI server like gunicorn so as not to experience stability issues.
Pageview Threshold Notification
The slackbot has the ability to poll Parsely’s realtime data endpoint and automatically alert you if any urls break a pageview threshold that you can set. Here’s how to set that up:
Go to the same custom integrations page as in the steps above.
At that page, click “Add Incoming Webhook”.
Select a channel you want the bot to send to (don’t worry about being too choosy- the bot can override this later in its settings) and click “Add Webhook Integration”. Once the webhook is created, make sure to copy the webhook url slack gives you. (Not required, though highly encouraged, is to name the integration and give it a new logo- you can use the logo provided above!)
in your config.yaml, change the parameter “webhook_url” to the webhook URL Slack gave you in the previous step. Also set the “threshold” parameter to the minimum number of pageviews a post must have in the past 5 minutes to trigger the trending alert.
under the “channels” list, add every channel you’d like the bot to send alerts to.
save the config.yaml, restart the bot, and you’re all set!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for parsely_slackbot-1.1.0-py2-none-any.whl