Code Monkey home page Code Monkey logo

zkill-to-slack's Introduction

zkill-to-slack

Post kills from zKillboard's RedisQ to Slack using local Node.js or AWS Lambda.

Installation

Local Node.js

  • Clone the git repository. git clone https://github.com/defmonk0/zkill-to-slack.git
  • Navigate into the created 'zkill-to-slack' directory. cd zkill-to-slack
  • Install all dependencies using npm. npm install
  • Edit the configuration file to meet your needs (see Environment Variables).
  • Run the project using npm as well. npm run start
  • If you want additional resistance to failure, consider using a node process manager.

AWS Lambda

Using Releases

  • Download the latest Lambda.zip from the releases page.
  • Create a new function in AWS Lambda.
    • Use "Author from scratch".
    • The name is up to you.
    • Use Node.js 6.10 as your runtime.
    • The role you use shouldn't need any special permissions.
  • After creating the function, upload your Lambda.zip file.
    • In the "Function code" section, you can change "Code entry type" drop-down to "Upload a .ZIP file".
    • Click the button, select your zip file, and then click the "Save" button in the top right of the window.
  • Set up your environment variables to meet your needs (see Environment Variables).
  • Set up a trigger for your new function, or select an existing one.
    • In the "Designer" section, select "CloudWatch Events" on the left.
    • In the "Configure triggers" section, select "Create a new rule" from the drop-down (or select an existing one).
    • Supply a name and description however you want. This will be reusable in the future.
    • Supply a "Schedule expression" for how often you want the script to run. rate(5 minutes)
    • Click the "Add" button, and then click the "Save" button in the top right of the window.

Build From Master

  • Clone the git repository. git clone https://github.com/defmonk0/zkill-to-slack.git
  • Navigate into the created 'zkill-to-slack' directory. cd zkill-to-slack
  • Install all dependencies using npm. npm install
  • Build a Lambda.zip using npm as well. It will be created in the "lambda" directory. npm run build
  • Continue following the instructions for Using Releases, ignoring the first step to download a release zip.

Configuration

Setup Instructions

Local Node.js

Simply edit the JSON file given in the node directory. ./node/config/environmentVariables.json

AWS Lambda

While editing a Lambda function, the "Environment variables" section allows you to supply key-value pairs. Create a key for each of the entries needed, and supply an associated value.

Available Variables

  • [required] channel (string)

    The slack channel you wish to post to.

    "#channel-name"

  • [optional] queueID (string)

    A unique identifier for zKillboard's RedisQ. This is used to track who you are so you do not duplicate or miss kills. It can be anything you want, as long as it's unique.

    "your-queue-id"

  • [required] slackHookURL (string)

    The Webhook URL for your Slack Custom Integration.

    "https://hooks.slack.com/services/YOUR/SLACK/HOOK"

  • [required] watchFor (string)

    An comma separated list of IDs for which you would like to be notified of kills. This can be Alliance, Corporation, or Character IDs.

    "123, 456, 789"

Example Slack Post

Example Slack Post

zkill-to-slack's People

Contributors

cvweiss avatar defmonk0 avatar mattcopenhaver avatar

Watchers

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