Git Product home page Git Product logo

slackeonnier's Introduction

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

slackeonnier's People

Contributors

hongyanhuang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.