定制 maxalmonte14/nfl-scores 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maxalmonte14/nfl-scores

Composer 安装命令:

composer create-project maxalmonte14/nfl-scores

包简介

A CLI for getting NFL games real-time data.

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Build Status StyleCI License: MIT

NFL-Scores is a CLI program that allows you to see the scores of live NFL games, as well as the list of games of the day and the current weekly schedule.

Requirements

PHP >= 7.1.3

Installation

composer require "maxalmonte14/nfl-scores"

How to use

Getting all live games

php nfl-scores live

That will show you something like this.

BAL VS BUF @ M&T Bank Stadium
3rd Quarter | 13:48 | BAL 1st & 10
+-----+----+----+---+---+----+----+
|     | 1  | 2  | 3 | 4 | OT | T  |
+-----+----+----+---+---+----+----+
| BAL | 14 | 12 | 0 | 0 | 0  | 26 |
| BUF | 0  | 0  | 0 | 0 | 0  | 0  |
+-----+----+----+---+---+----+----+


CLE VS PIT @ FirstEnergy Stadium
3rd Quarter | 08:24 | PIT 1st & 10
+-----+---+---+---+---+----+----+
|     | 1 | 2 | 3 | 4 | OT | T  |
+-----+---+---+---+---+----+----+
| CLE | 0 | 0 | 7 | 0 | 0  | 7  |
| PIT | 0 | 7 | 7 | 0 | 0  | 14 |
+-----+---+---+---+---+----+----+

You can see the teams that are playing, at which stadium, the current quarter, the clock, the possession team, the current down, and the yards to go. Pretty good, ah?

Getting your favorite team live game

You can get one specific live game just passing a parameter with your team abbreviation to the live command.

php nfl-scores live CLE

And now you have the Cleveland Browns game live on your terminal!

CLE VS PIT @ FirstEnergy Stadium
3rd Quarter | 08:24 | PIT 1st & 10
+-----+---+---+---+---+----+----+
|     | 1 | 2 | 3 | 4 | OT | T  |
+-----+---+---+---+---+----+----+
| CLE | 0 | 0 | 7 | 0 | 0  | 7  |
| PIT | 0 | 7 | 7 | 0 | 0  | 14 |
+-----+---+---+---+---+----+----+

Getting a list of today's games

If you want to see what teams are going to play today you can use the today command.

php nfl-scores today

That will show an output as the following.

+------+---------+-------------------------------+------------+-------------+
| Home | Visitor | Stadium                       | Date       | Hour        |
+------+---------+-------------------------------+------------+-------------+
| ATL  | NO      | Mercedes-Benz Stadium         | 09/23/2018 | 13:00:00 ET |
| LA   | LAC     | Los Angeles Memorial Coliseum | 09/23/2018 | 16:05:00 ET |
| ARI  | CHI     | State Farm Stadium            | 09/23/2018 | 16:25:00 ET |
| SEA  | DAL     | CenturyLink Field             | 09/23/2018 | 16:25:00 ET |
| DET  | NE      | Ford Field                    | 09/23/2018 | 20:20:00 ET |
| BAL  | DEN     | M&T Bank Stadium              | 09/23/2018 | 13:00:00 ET |
| CAR  | CIN     | Bank of America Stadium       | 09/23/2018 | 13:00:00 ET |
| HOU  | NYG     | NRG Stadium                   | 09/23/2018 | 13:00:00 ET |
| JAX  | TEN     | TIAA Bank Field               | 09/23/2018 | 13:00:00 ET |
| KC   | SF      | Arrowhead Stadium             | 09/23/2018 | 13:00:00 ET |
| MIA  | OAK     | Hard Rock Stadium             | 09/23/2018 | 13:00:00 ET |
| MIN  | BUF     | U.S. Bank Stadium             | 09/23/2018 | 13:00:00 ET |
| PHI  | IND     | Lincoln Financial Field       | 09/23/2018 | 13:00:00 ET |
| WAS  | GB      | FedExField                    | 09/23/2018 | 13:00:00 ET |
+------+---------+-------------------------------+------------+-------------+

Getting today's finished games

The live command won't show you the finished games, so, if want to know the final results of a game you should use the finished command.

php nfl-scores finished

The output will be like the following:

PHI VS ATL @ Lincoln Financial Field
+-----+---+---+---+---+----+----+
|     | 1 | 2 | 3 | 4 | OT | T  |
+-----+---+---+---+---+----+----+
| PHI | 0 | 3 | 7 | 8 | 0  | 18 |
| ATL | 3 | 3 | 0 | 6 | 0  | 12 |
+-----+---+---+---+---+----+----+

BAL VS BUF @ M&T Bank Stadium
+-----+----+----+----+---+----+----+
|     | 1  | 2  | 3  | 4 | OT | T  |
+-----+----+----+----+---+----+----+
| BAL | 14 | 12 | 14 | 8 | 0  | 47 |
| BUF | 0  | 0  | 3  | 0 | 0  | 3  |
+-----+----+----+----+---+----+----+

You can also get one specific game passing a parameter to the finished command.

php nfl-scores finished PHI

The output will be like the following:

PHI VS ATL @ Lincoln Financial Field
+-----+---+---+---+---+----+----+
|     | 1 | 2 | 3 | 4 | OT | T  |
+-----+---+---+---+---+----+----+
| PHI | 0 | 3 | 7 | 8 | 0  | 18 |
| ATL | 3 | 3 | 0 | 6 | 0  | 12 |
+-----+---+---+---+---+----+----+

Getting the games for this week

The week command will show the games for the current week.

php nfl-scores week

Note: Remember, a week in the NFL is composed by a Thursday, a Sunday and the Monday of next week.

The output will be similar to the following.

+------+---------+-------------------------------+------------+-------------+
| Home | Visitor | Stadium                       | Date       | Hour        |
+------+---------+-------------------------------+------------+-------------+
| ATL  | NO      | Mercedes-Benz Stadium         | 09/23/2018 | 13:00:00 ET |
| LA   | LAC     | Los Angeles Memorial Coliseum | 09/23/2018 | 16:05:00 ET |
| ARI  | CHI     | State Farm Stadium            | 09/23/2018 | 16:25:00 ET |
| SEA  | DAL     | CenturyLink Field             | 09/23/2018 | 16:25:00 ET |
| DET  | NE      | Ford Field                    | 09/23/2018 | 20:20:00 ET |
| BAL  | DEN     | M&T Bank Stadium              | 09/23/2018 | 13:00:00 ET |
| CAR  | CIN     | Bank of America Stadium       | 09/23/2018 | 13:00:00 ET |
| HOU  | NYG     | NRG Stadium                   | 09/23/2018 | 13:00:00 ET |
| JAX  | TEN     | TIAA Bank Field               | 09/23/2018 | 13:00:00 ET |
| KC   | SF      | Arrowhead Stadium             | 09/23/2018 | 13:00:00 ET |
| MIA  | OAK     | Hard Rock Stadium             | 09/23/2018 | 13:00:00 ET |
| MIN  | BUF     | U.S. Bank Stadium             | 09/23/2018 | 13:00:00 ET |
| PHI  | IND     | Lincoln Financial Field       | 09/23/2018 | 13:00:00 ET |
| WAS  | GB      | FedExField                    | 09/23/2018 | 13:00:00 ET |
| TB   | PIT     | Raymond James Stadium         | 09/24/2018 | 20:15:00 ET |
| CLE  | NYJ     | FirstEnergy Stadium           | 09/20/2018 | 20:20:00 ET |
+------+---------+-------------------------------+------------+-------------+

What this program cannot do

This program has its limitations, the NFL hasn't an open API to get precise data at any time you want, so I'm using an NFL Game Center JSON file which is updated every certain time to get the data that the CLI show.

For that reason this program cannot do the following things:

  • Show information about games played before the current NFL week.
  • Show player stats, because they're not contained in the JSON file.

What this program doesn't do but could do!

There is a lot of things that I would love to add in future versions of this program, these are some of them:

  • Show the output in a prettier way. Everybody loves nice things!
  • Update the data in real time. For the moment anytime you run the live command the program will show you the score at that time, you need to run the command over and over again every time you want to see the updated data.
  • Show notifications every time a team scores or the game is finished.
  • Store passed games in a database.

What this program can improve

There is a lot of things that can be done to improve this program, there are a few of them:

  • Refactor! Everything turns better when you refactor it.
  • Add some Feature tests. Of course this program has a test suite, but I focused on the Unit tests, so adding some features test is a must-do task.
  • Speed up. Everybody loves fast things.

Contributing

Do you like this little app? Do you follow the PSR standards? It sounds good to me! Send me a PR, and don't forget to add some tests.

maxalmonte14/nfl-scores 适用场景与选型建议

maxalmonte14/nfl-scores 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 16, 最近一次更新时间为 2018 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cli」 「terminal」 「sports」 「football」 「nfl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 maxalmonte14/nfl-scores 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 maxalmonte14/nfl-scores 我们能提供哪些服务?
定制开发 / 二次开发

基于 maxalmonte14/nfl-scores 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 12
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-16