Giter VIP home page Giter VIP logo

fifa-world-cup-slack's Introduction

A sample run

NAME

world-cup-slack 0.04

DESCRIPTION

Downloads World Cup live game events from FIFA API & posts to Slack.

Run following command to install dependencies.

cpanm File::Slurper Furl Getopt::Long List::Util JSON::XS

Script comes with a debug mode, where you can pass a timeline.json and it prints messages to screen. Debug mode requires one time download of calendar to get team names.

You can set a cronjob to run at every minute to utilize this script.

SYNOPSIS

First, you will need a Slack incoming webhook URL. Here's how to get it:

Post to slack incoming webhook URL.

perl world-cup-slack.pl --slack=https://hooks.slack.com/services/...

Process an existing JSON file for debug

perl world-cup-slack.pl --debug=12345678.json

Increase politeness sleep (defaults to 2 seconds)

perl world-cup-slack.pl --slack=... --sleep=10

Specify multiple Slack URLs to post to multiple workspaces

perl world-cup-slack.pl --slack=... --slack=...

Specify name and location of db.json file. This may be helpful if you are running multiple instances of script.

perl world-cup-slack.pl --slack=... --dbjson=/some/file.json

Testing by posting to Slack is also possible. Use following instructions.

  • Remove your db.json file.
  • Run script once with --slack argument provided.
  • Go into db.json and manually update one of the "status:0" games to "status:3"
  • Run script second time, it will collect events and keep them with "posted:0"
  • Run script for third time. It will post all events at once.

LICENSE

MIT.

ATTRIBUTION

This script is partly based on j0k3r/worldcup-slack-bot which was written in PHP.

fifa-world-cup-slack's People

Contributors

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