Giter Club home page Giter Club logo

slackmatlab's Introduction

README

This repository contains Matlab functions to send notifications to a Slack channel or user, via the Slack Incoming Webhooks API.

Usage

SendSlackNotification is used to send a notification to a URL provided by Slack, for a configured Incoming Webhooks integration. See the documentation for this function for information on options.

MakeSlackAttachments can be used to generate Slack message attachments, which can then be sent as notifications using SendSlackNotification. See the documentation for this function for more information.

Set up

  1. Configure an Incoming Webhooks integration for your team, from your team's services page.
  2. Copy the Webhook URL once the service is configured, and store it in a Matlab string.
  3. Clone the SlackMatlab repository, and add the root directory to the Matlab path using pathtool.
  4. Call SendSlackNotification, passing the Webhook URL as an argument.

Example

% - Create a message attachment to send with a notification
%   (optional; several message attachments can be sent with a single notification)
sA = MakeSlackAttachment('New open task [urgent]: <link.to.website>', 'Text of the notification message', ...
      'Text that will be displayed before the message', '#0000ff', ...
      {'Field 1 title', 'This is a field that will be shown in a table'}, ...
      {'Field 2 title', 'This is another field that will be shown in a table'});

% - Send the notification, with the attached message
SendSlackNotification('https://hooks.slack.com/services/this/is/your/webhook/url', ...
   'I sent this notification from matlab, on behalf of @username.', '#target-channel', ...
   'Name to post under', 'http://www.icon.com/url/to/icon/image.png', [], sA);

Emojis

A list of Emojis supported by Slack is available from http://www.emoji-cheat-sheet.com.

Acknowledgements

Contains code from URLREAD2 and JSONLAB.

slackmatlab's People

Contributors

dylanmuir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jakewesterberg

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.