Git Product home page Git Product logo

slack-functions's Introduction

slack-functions

This repo contains four different Azure functions used to extract and save data from a Slack team.

There are two main streams of work:

New messages

Functions involved:

  • HttpTriggerJS1
  • BlobTriggerJS1

Whenever a new message is posted in a Slack channel, HttpTriggerJS1 receives an HTTP request with the content of the message and some additional information. This function verifies that the message is correct and saves it to an Azure Blob storage. This last operation triggers the other function BlobTriggerJS1, which is constantly checking if a new blob has been saved in a container. When this happens, the function simply takes the content and replicates it into a NoSQL Azure database.

Events Logs

Functions involved:

  • TimerTriggerJS1
  • BlobTriggerJS2

The first function TimerTriggerJS1 makes an API call every three minutes, asking for the Slack events logs. Once it receives an answer, the function enriches it with the current timestamp and saves everything to an Azure Blob storage. The stream then proceeds as the previous one, where the second function BlobTriggerJS2 saves the data in another collection.

Notes

Some of the relevant files have been gitignored before creating this public repo. To reproduce everything, follow these steps:

  1. In the Kudu Azure console, navigate to TimerTriggerJS1/ and run
npm install request request-promise
  1. Create TimerTriggerJS1/slack-info.js with the following structure:
module.exports = {
    token: 'YOUR SLACK TOKEN'
};

slack-functions's People

Watchers

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