manrajgrover/football-cli

Add notification feature when scoring a goal

derycktse opened this issue · 3 comments

Thought that it will be nice when a goal happen, the cli can push a terminal notification. Is it possible?

@derycktse Yes, this is something that is possible. There are packages for it, for example node-notifier.

But where should we get the information from is the question. The event api is currently not documented. Maybe we would have to look into other free api alternatives or scrape it in the background.

There is an awful way with current api:
Maybe we can store the score. Next time when we got the new result, compare with previous one. If the score is change , there must be a goal.

There is a Twitter Handle @GoalFlash. According to goal.com initiative: @GoalFlash will let you know when a team has scored within three seconds of the ball hitting the back of the net. Twitter API will do the rest of work. But, we need to take care of time of tweets and compare them so that we can confirm that the tweet read by API is latest. The tweet will contain all the information of the goal. We can try this.