Skip to main content

Parsely Slackbot

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.

Run:

` 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

  1. In your channel settings, select “Customize Slack.” Choose “Configure Apps” –> “Custom Integrations”

  2. Add a “Slash Commands” integration

  3. In the “command” section, enter the slash_command value from the config (the default is parsely).

  4. 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)

  5. 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.

Usage

Command syntax:
/parsely meta, time

meta = posts, authors, sections, tags, referrers
time = Xm, Yh, today. Max of 24h.

Sample commands:

/parsely posts, 10m
Will return the top posts in the last 10 minutes

/parsely sections, 1h
Will return the top sections in the last hour

/parsely tags, today
Will return the top tags for today

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:

  1. Go to the same custom integrations page as in the steps above.

  2. At that page, click “Add Incoming Webhook”.

  3. 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!)

  4. 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.

  5. 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!

Release files for parsely-slackbot 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parsely-slackbot 1.1.0
File Size Uploaded
parsely-slackbot-1.1.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for parsely-slackbot 1.1.0
File Interpreter ABI Platform
parsely_slackbot-1.1.0-py2-none-any.whl Python 2 none any Details

Total release size: 19.2 kB

Release files / parsely-slackbot-1.1.0.tar.gz

Download URL parsely-slackbot-1.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ff785a7954a684ad762a77c31aadd1e4a979f2f63ca321e054175506ea25f0cb
BLAKE2b-256 checksum
How to use checksums
a2d921ddc89a4e28c5b92d30d917a8f0cb1240ed5b50d46d3a106c19ddef1d51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / parsely_slackbot-1.1.0-py2-none-any.whl

Download URL parsely_slackbot-1.1.0-py2-none-any.whl
Size 11.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
5a5c076a7c04db31f1b97ceb9fc6881ebc5b7c7172a0c115f0bcf0a77f67249c
BLAKE2b-256 checksum
How to use checksums
5ea628f682783f304bf2965f9d953c7053589f528076e8646558b963b5dfac38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page