Giter Site home page Giter Site logo

football-cli's Introduction

football-cli

Build Status npm version npm awesome

Command line interface for Hackers who love football ⚽

Standings

Installation

Run

$ npm install -g footballcli

How to get API Key?

Please register on football-data.org to get your API Key. Then run $ football config to add your API Key (use sudo if required). Requests made using API key increases your rate limit from 50 requests per day to 50 requests per minute.

Usage

Commands available

football <command>

Commands:
  scores     Get scores of past and live fixtures
  fixtures   Get upcoming and past fixtures of a league and team
  standings  Get standings of particular league
  lists      List of codes of various competitions
  config     Change configuration and defaults

Options:
  -h, --help  Show help                                          [boolean]
  

Command scores

Get scores of past and live fixtures

Standings

Usage: football scores [options]

Options:
  -h, --help  Show help                                          [boolean]
  -l, --live  Live scores                                        [boolean]
  -t, --team  Select team                                        [string]

Examples:
  football scores -t "Manchester United" -l
  

Command fixtures

Get upcoming and past fixtures of a league and team

Usage: football fixtures [options]

Options:
  -h, --help    Show help                                         [boolean]
  -d, --days    Number of days from today                         [number]
  -l, --league  League                                            [string]
  -t, --team    Team name or substring of it                      [string]
  -n, --next    Next or upcoming matches                          [boolean]

Examples:
  football fixtures -l PL -d 5 -t "Manchester United" -n

Fixtures

Command standings

Get standings of particular league

Usage: football standings [options]

Options:
  -h, --help    Show help                                         [boolean]
  -l, --league  League to be searched                             [required]

Examples:
  football standings -l PL

Command lists

List of codes of various competitions

Usage: football lists [options]

Options:
  -h, --help     Show help                                        [boolean]
  -r, --refresh  Refresh league ids                               [boolean]

Examples:
  football lists -r

Command config

Change configuration and defaults

Usage: football config

Options:
  -h, --help  Show help                                           [boolean]

Examples:
  football config
  

Note

For World Cup fixtures, you need to specify league flag with value as WC. API does not provide world cup information in consolidated response and is a known bug.

Development

Run:

$ git clone https://github.com/manrajgrover/football-cli.git
$ cd football-cli
$ npm link

This will setup a symbolic link to the CLI. Any changes in source files will now be reflected when running the football command.

To lint your code, run

$ npm run lint

Get in touch

Say hi on twitter and share this project by clicking here

Related

You may find similar packages here

License

MIT © manrajgrover

football-cli's People

Contributors

armansujoyan avatar fearphage avatar leereilly avatar manrajgrover avatar sudheer-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

football-cli's Issues

Not able to see upcoming matches

BUG REPORT
Bug: {Not able to see upcoming matches for Argentina}

SUGGESTION
Suggestion: {Should be able to see, upcoming matches of team}

Versions

  • NodeJS version: v10.5.0
  • Football CLI version: Not able to get it.

image

Error

Was not able to see upcoming match of argentina, which according to my timezone is today

Expected behaviour

Should be able to see upcoming match

Steps to recreate

Have added screenshot

image

Running watch on the command is returning unformatted output

Description

When running watch on the cli command, like watch -n 60 football standings --league WC which runs the command after every 60 seconds, just like refreshing, the output is
screenshot from 2018-06-27 15-55-58

Versions

  • NodeJS version: 6.14.3
  • Football CLI version: 0.14.9

Error

Expected behaviour

Steps to recreate

  • Run watch on top of football cli commands such as watch football standings -l WC

People to notify

npm install throws: "node postinstall shell-init: error retrieving current directory"

Tried install with sudo but no luck. Can provide logs if needed.

`/usr/local/bin/football -> /usr/local/lib/node_modules/footballcli/cli.js

[email protected] postinstall /usr/local/lib/node_modules/footballcli/node_modules/spawn-sync
node postinstall

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:1142
cwd = process.cwd();
^

Error: EACCES: permission denied, uv_cwd
at Error (native)
at Object.resolve (path.js:1142:25)
at startup (bootstrap_node.js:127:32)
at bootstrap_node.js:509:3
/usr/local/lib
└── (empty)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node postinstall'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spawn-sync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Tobi/.npm/_logs/2017-05-05T00_02_41_132Z-debug.log
`

Fix League Ids

Api has changed list of league ids. Need to change those in current repository.

Feature: Allow manually adding rare competitions

Description

Currently, on refreshing the league list, the rare competitions like World Cup is not added. We should allow user to add manual list of competitions for such occasions.

Versions

  • NodeJS version (if applicable): NA
  • Football CLI version: 0.14.0

Error

NA

Expected behaviour

NA

Steps to recreate

NA

People to notify

@manrajgrover

Can't configure the program nor use it

Description

Versions

  • NodeJS version: 6.14.5
  • Football CLI version: 0.1.1

Error

› football-cli help
/usr/lib/node_modules/football-cli/index.js:9
fd.getLeagugeFixturesInTimeFrame(424, "n1").then(function(res) {
   ^

TypeError: fd.getLeagugeFixturesInTimeFrame is not a function
    at Object.<anonymous> (/usr/lib/node_modules/football-cli/index.js:9:4)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

Expected behaviour

The application to show the help menu, configuration, or standings. But on executing any football-cli command, I get a stacktrace of errors. I have no idea what is causing this.

Steps to recreate

Running any football-cli command in Arch linux

sudo: football: command not found

i cant run sudo football config, and get notif sudo: football: command not found
i used zsh shell in LinuxMint OS
how to fix this?

Suggestion: format fixture.date to local time

Description

football fixtures returns fixture date and time in the original time zone (or maybe UTC?)

Suggestion

use moment.js local() to convert to user's local time
perhaps, add this an option using a flag or toggle in configuration

Happy to open if PR if you like?

SUGGESTION: Add MLS

Description

I can't get my dad gum amurrican soccer scores

Versions

  • NodeJS version: 8.9.1
  • Football CLI version: any

Error

When I try football fixtures -l MLS, nothing happens

Expected behaviour

I should be able to see MLS scores.

Steps to recreate

Should be self-explanatory.

People to notify

I hope we can add this to the choices available 😄

League Standings table format

Description

When viewing the Serie A standings table, one of the columns was not formatted correctly. Could be because the team name is pretty long

screen shot 2018-03-07 at 11 12 47 am

Versions

  • NodeJS version (if applicable): v6.11.2
  • Football CLI version: 0.13.12

Error

Expected behaviour

Steps to recreate

football standings -l SA
football standings -l ELC

People to notify

@manrajgrover

What does -d flag do?

Description

football fixtures -l PL -d 5 -t "Manchester United" -n

In this, what does the -d refer to?

Versions

  • NodeJS version (if applicable):
  • Football CLI version:

Error

Expected behaviour

Steps to recreate

People to notify

@manrajgrover

Streamline config file

Config sample needs to be added and instructions on how to use it needs to be documented.

Refactor code

  • Refactor code in helper.js
  • Move constants out in separate file

Add snapcraft.yaml file

Today I created a snap of football-cli and this PR will contain a snapcraft.yaml to enable building of an football-cli snap. I've tested the snap to make sure it works as expected, and find no issues so far.

I'd love to hear if you are generally interested in your software being available as a snap and if you could imagine shipping the snapcraft.yaml file in your source repository for easier publishing.

Background info

If you haven't heard of snaps yet, they are self-contained apps, which can be used on a multitude of Linux systems. Via seccomp, apparmor and other Linux security features, they provide great security for users, uploads to the store are available within seconds and you have
full control over your relevant stack.

Snaps can be installed by millions of users: Ubuntu 16.04 LTS and later have snapd installed by default and many other Linux distributions, like Arch, Debian, Gentoo, Fedora, openSUSE, OpenEmbedded, Yocto and OpenWRT made snapd (which powers the snap experience) available as well.

Publishing

Uploading to the store can be done via the command line and there are multiple release channels available, so users can choose between for example stable, beta and alpha releases. You could even hook up snapcraft upload with Travis to auto-publish release tags or nightly builds. The process for this is very simple:

Once:

Add support for penalty scoreline

Description

Currently, only end time scores are shown. For knockout stages, we should add penalty scoreline as well.

Versions

  • NodeJS version: NA
  • Football CLI version: 0.14.10

People to notify

@manrajgrover

Demos: Move demo gifs to svg based demos

Description

Currently, we make use of gif demos, which is cool, but not as cool as svg-term-cli. Need to explore and move demos to svg based terminal sessions to improve documentation.

Versions

  • NodeJS version (if applicable):
  • Football CLI version:

Error

Expected behaviour

Steps to recreate

People to notify

Fix JSDocs for the project

Description

This code was written long back, probably when I didn't know much about documentation. While going through the code, I felt there is a need to fix the JSDocs here.

Versions

  • NodeJS version (if applicable): NA
  • Football CLI version: NA

Error

NA

Expected behaviour

NA

Steps to recreate

NA

People to notify

Feature: Show full detailed league standings

Description

Currently, only a subset of fields is shown in standings. We should show full table as output.

Versions

  • NodeJS version: NA
  • Football CLI version: 0.14.3

Error

NA

Expected behaviour

NA

Steps to recreate

NA

People to notify

@manrajgrover

Bug: Handle multiple standings response in League standings

Description

Case where there are multiple groups in standings is currently not handled. This needs to be fixed.

Versions

  • NodeJS version (if applicable): NA
  • Football CLI version: 0.14.0

Error

/Users/manrajsingh/Github/football-cli/helpers.js:222
      for (let team of group) {
                       ^

TypeError: group is not iterable
    at standings (/Users/manrajsingh/Github/football-cli/helpers.js:222:24)
    at Request.request [as _callback] (/Users/manrajsingh/Github/football-cli/cli.js:197:9)
    at Request.self.callback (/Users/manrajsingh/Github/football-cli/node_modules/request/request.js:187:22)
    at Request.emit (events.js:159:13)
    at Request.<anonymous> (/Users/manrajsingh/Github/football-cli/node_modules/request/request.js:1048:10)
    at Request.emit (events.js:159:13)
    at IncomingMessage.<anonymous> (/Users/manrajsingh/Github/football-cli/node_modules/request/request.js:969:12)
    at IncomingMessage.emit (events.js:164:20)
    at endReadableNT (_stream_readable.js:1054:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)

Expected behaviour

League standings should be shown

Steps to recreate

$ football standings -l CL

People to notify

@manrajgrover

Fails to start because of syntax error

All I get after installing with npm is.

Input: football

Output:

const updateMessage = (TYPE, message = "") => {
                                     ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/knusper/.npm-packages/lib/node_modules/footballcli/cli.js:22:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

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.