j0k3r / worldcup-slack-bot Goto Github PK
View Code? Open in Web Editor NEWWorldCupBot will notify a Slack channel/group for every match during a FIFA World Cup
License: MIT License
WorldCupBot will notify a Slack channel/group for every match during a FIFA World Cup
License: MIT License
Is there any chance of an update to this bot for 2018?
Has anyone taken a look at the FIFA API to see if this bot will work with the Women's World Cup next month?
According the previous Colombia/Japan match, it seems the type number for the straight red card is 3 but not 4 like the following defines.
worldcup-slack-bot/worldCupNotifier.php
Line 88 in c23aa06
Refer to the match's events :
https://api.fifa.com/api/v1/timelines/17/254645/275073/300331550?language=fr-FR&count=1
{
"EventId": "-1011232931",
"IdTeam": "43926",
"IdPlayer": "280487",
"IdSubPlayer": null,
"Timestamp": "2018-06-19T12:03:58.871Z",
"MatchMinute": "3'",
"Period": 3,
"HomeGoals": 0,
"AwayGoals": 0,
"Type": 3,
"TypeLocalized": [],
"PositionX": null,
"PositionY": null,
"GoalGatePositionX": null,
"GoalGatePositionY": null,
"GoalGatePositionZ": null,
"VarDetail": null,
"HomePenaltyGoals": 0,
"AwayPenaltyGoals": 0
}
$ php worldCupNotifier.php
Fatal error: Uncaught Error: Call to undefined function curl_init() in C:\Users\nokram\Documents\salesforce\workspace\worldcup-slack-bot\worldCupNotifier.php:124
Stack trace:
#0 C:\Users\nokram\Documents\salesforce\workspace\worldcup-slack-bot\worldCupNotifier.php(219): getUrl('https://api.fif...')
#1 {main}
thrown in C:\Users\nokram\Documents\salesforce\workspace\worldcup-slack-bot\worldCupNotifier.php on line 124
#########################3
below is the php details
$ php --version
PHP 7.2.7 (cli) (built: Jun 19 2018 23:13:48) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Event type 71 seems to be VAR activity. It may be for several things like: incident being investigated, incident referred for review, final referee decision etc. Quite hard to reverse engineer.
From some examples I've seen, potentially these are:
// VAR
const VAR_INCIDENT_GOAL = 1;
const VAR_INCIDENT_NO_GOAL = 2; // Maybe?
const VAR_INCIDENT_PENALTY = 3;
const VAR_INCIDENT_NO_PENALTY = 4;
const VAR_INCIDENT_RED_CARD = 5; // Maybe?
const VAR_INCIDENT_NO_RED_CARD = 6;
const VAR_REASON_OFFSIDE = 1; // Maybe?
const VAR_REASON_FOUL = 5; // Maybe?
const VAR_REASON_HANDBALL = 6; // Maybe?
const VAR_STATUS_WATCHING = 0;
const VAR_STATUS_REVIEW = 1;
const VAR_STATUS_ONFIELD_REVIEW = 2;
const VAR_STATUS_VAR_DECISION = 3;
const VAR_STATUS_ONFIELD_DECISION = 4;
const VAR_RESULT_GOAL_AWARDED = 1;
const VAR_RESULT_GOAL_DISALLOWED = 2; // Maybe?
const VAR_RESULT_PENALTY_AWARDED = 3;
const VAR_RESULT_PENALTY_REVERSED = 4;
const VAR_RESULT_YELLOW_CARD = 7; // Or at least, no red card
const VAR_RESULT_NO_CHANGE = 9;
Thank you to Spain and Russia for giving us a test case.
From looking at the JSON from the FIFA API it looks like extra time could get mapped as such by the bot:
const PERIOD_1ST_ET = 7;
const PERIOD_2ND_ET = 9;
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/jason/projects/worldcup-slack-bot/worldCupNotifier.php on line 405
Do you guys noticed the duplicate post on slack? is it the fifa api?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.