Skip to content

Send data notifications with color and plot to Slack.

Notifications You must be signed in to change notification settings

HongYanHuang/slackeonnier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

Slackeonnier 🕊️

Slackeonnier - send data notifications with color and plot to Slack by 🕊️.

Features

🚥 Customized Color Management

📊 Plot + Text + Color = DONE!

🔕 Mute redundant quetions from your boss

Basic Idea

Complete ideation and implementation please check out medium article.

Installation

# Depeche mode
devtools::install_github("HongYanHuang/slackeonnier")

# Classic - coming soon
# install.packages("slackeonnier")

Quick Start

1. Load library and setup

# load library
library(slackeonnier)
## setup slackeonnier
slackeonnier_setup(upload_api_token = "your slack upload token",
                   upload_image_channel = "#your-storage-channel",
                   incoming_webhook_url = "your incoming webhook",
                   sent_channel = "#general",
                   username = " ")

2. Plot + Text + Color =

## upload your plot, will return a private slack-url for attach
plot_url <- plot_upload(plot = your.plot)

## formating text, color, plot
atc <- attachment_format(former_text = your_text,
                  status_color = color_hex,
                  image_url = plot_url)

3. DONE 🕊️

## sent by slackeonnier
slackeonnier_sent(atc)

Example

run example script

Main Functions

slackeonnier_setup

Recommended in setting environment argument for slackeonnier; otherwise you must provide in every function needed.

Name Format Require Description
upload_api_token string Yes file:upload token
upload_image_channel string Yes alternative channel for uploading plot, default #random
incoming_webhook_url string Yes incoming webhook for posting notification
sent_channel string No will post notification to this channel, default #general
username string No name of slack App, default slackeonnier

plot_upload

Upload your ggplot object to slack and return a private url for upcoming attach in message.

Name Format Require Description
plot ggplot object Yes ggplot object to upload
upload_api_token string Yes use slackeonnier_setup()
upload_image_channel string Yes use slackeonnier_setup()

attachment_format

Plot + Text + Color formatting as an attachment object.

Name Format Require Description
former_text string Yes text in message
status_color string Yes Hex code
image_url string No your url from plot_upload()

slackeonnier_sent

sent attachment to slack channel

Name Format Require Description
attachment json Yes text in message
webhook string Yes use slackeonnier_setup()
channel string No use slackeonnier_setup(), default #general
username string No use slackeonnier_setup(), default slackeonnier

About

Send data notifications with color and plot to Slack.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages