footty 2026.5.25 → 2026.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/README.md +19 -22
- data/Rakefile +5 -2
- data/bin/footty +7 -0
- data/bin/ftty +6 -0
- data/lib/footty/dataset/openfootball.rb +12 -4
- data/lib/footty/pp_matches.rb +36 -10
- data/lib/footty/version.rb +1 -1
- data/lib/footty.rb +0 -7
- metadata +49 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e610fb1316252ad640f6dc1797ff85af9252b00c7f3c90d4d182e683490f77b4
|
|
4
|
+
data.tar.gz: cacbd8b21aaa4f0e29225b158da9c0a35dc825ff6cfdbc4532662fa71997404c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8db64064a0d96b3c70a7a75fdb5246864c4e13ad950c39eb6a43795f6d6f9af45bf84f8a7590c46664c14547769c51b8116e030e64e1271df17be31e279f9a85
|
|
7
|
+
data.tar.gz: 94ab96e8e3dca3efa6a80fd30a72a469a41271b0819d9ff2a2ebafeb1b6491f10a043a4acc93c3f6f9a0bf99fb06309b9a03f127e26ba9b124b9ac2b07b44ef9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
## Step 0 - Installation Via Gems
|
|
12
|
+
|
|
13
|
+
To install the command-line tool via gems (ruby's package manager) use:
|
|
14
|
+
|
|
15
|
+
$ gem install footty
|
|
16
|
+
|
|
11
17
|
|
|
12
18
|
|
|
13
19
|
## Usage - Who's playing today?
|
|
@@ -17,21 +23,20 @@ for upcoming or past matches. For example:
|
|
|
17
23
|
|
|
18
24
|
$ footty # Defaults to today's matches of top leagues
|
|
19
25
|
|
|
20
|
-
|
|
21
26
|
prints on Sep 27, 2024:
|
|
22
27
|
|
|
23
28
|
==> English Premier League 2024/25
|
|
24
|
-
|
|
25
|
-
Sat Sep 28 12:30 (in 1d) Newcastle United FC
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Sun Sep 29 14:00 (in 2d) Ipswich Town FC
|
|
33
|
-
|
|
34
|
-
Mon Sep 30 20:00 (in 3d) AFC Bournemouth
|
|
29
|
+
▪ Matchday 6 ▪
|
|
30
|
+
Sat Sep 28 12:30 (in 1d) Newcastle United FC v Manchester City FC
|
|
31
|
+
15:00 (in 1d) Arsenal FC v Leicester City FC
|
|
32
|
+
15:00 (in 1d) Brentford FC v West Ham United FC
|
|
33
|
+
15:00 (in 1d) Chelsea FC v Brighton & Hove Albion
|
|
34
|
+
15:00 (in 1d) Everton FC v Crystal Palace FC
|
|
35
|
+
15:00 (in 1d) Nottingham Forest FC v Fulham FC
|
|
36
|
+
17:30 (in 1d) Wolverhampton Wanderers FC v Liverpool FC
|
|
37
|
+
Sun Sep 29 14:00 (in 2d) Ipswich Town FC v Aston Villa FC
|
|
38
|
+
16:30 (in 2d) Manchester United FC v Tottenham Hotspur FC
|
|
39
|
+
Mon Sep 30 20:00 (in 3d) AFC Bournemouth v Southampton FC
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
|
|
@@ -45,7 +50,7 @@ Use `--yesterday` or `-y` to print yesterday's matches e.g.:
|
|
|
45
50
|
$ footty --yesterday # -or-
|
|
46
51
|
$ footty -y
|
|
47
52
|
|
|
48
|
-
Use `--upcoming
|
|
53
|
+
Use `--upcoming`/`--up` or `-u` to print all upcoming matches e.g.:
|
|
49
54
|
|
|
50
55
|
$ footty --upcoming # -or-
|
|
51
56
|
$ footty --up
|
|
@@ -91,19 +96,11 @@ See [footty/openfootball](https://github.com/sportdb/footty/blob/master/footty/l
|
|
|
91
96
|
Why tty? tty stands for teletype (tty) writer and is the old traditional (short) name for the unix command line.
|
|
92
97
|
|
|
93
98
|
|
|
94
|
-
## Install
|
|
95
|
-
|
|
96
|
-
Just install the gem:
|
|
97
|
-
|
|
98
|
-
$ gem install footty
|
|
99
|
-
|
|
100
99
|
|
|
101
100
|
## License
|
|
102
101
|
|
|
103
102
|
The `footty` scripts are dedicated to the public domain.
|
|
104
|
-
Use
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
Use as you please with no restrictions whatsoever.
|
|
107
104
|
|
|
108
105
|
|
|
109
106
|
## Questions? Comments?
|
data/Rakefile
CHANGED
|
@@ -4,7 +4,7 @@ require './lib/footty/version.rb'
|
|
|
4
4
|
Hoe.spec 'footty' do
|
|
5
5
|
self.version = Footty::VERSION
|
|
6
6
|
|
|
7
|
-
self.summary = "footty - football.db command line tool for national & int'l football club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)"
|
|
7
|
+
self.summary = "footty - football.db command line tool(s) for national & int'l football club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)"
|
|
8
8
|
self.description = summary
|
|
9
9
|
|
|
10
10
|
self.urls = { home: 'https://github.com/sportdb/footty' }
|
|
@@ -17,8 +17,11 @@ Hoe.spec 'footty' do
|
|
|
17
17
|
self.history_file = 'CHANGELOG.md'
|
|
18
18
|
|
|
19
19
|
self.extra_deps = [
|
|
20
|
-
['sportdb-quick', '>= 0.7.0'],
|
|
21
20
|
['webget'],
|
|
21
|
+
['sportdb-parser', '>= 0.8.0'],
|
|
22
|
+
['sportdb-quick', '>= 0.8.0'],
|
|
23
|
+
['fbtok'],
|
|
24
|
+
['fbtxt2json']
|
|
22
25
|
]
|
|
23
26
|
|
|
24
27
|
self.licenses = ['Public Domain']
|
data/bin/footty
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
## tip: to test run:
|
|
4
4
|
## ruby -I ./lib bin/footty
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
## quick hack
|
|
8
|
+
## if available always use latest (local) source version
|
|
9
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
|
|
10
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
require 'footty'
|
|
7
14
|
|
|
8
15
|
Footty.main
|
data/bin/ftty
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
## tip: to test run:
|
|
4
4
|
## ruby -I ./lib bin/ftty
|
|
5
5
|
|
|
6
|
+
## quick hack
|
|
7
|
+
## if available always use latest (local) source version
|
|
8
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
|
|
9
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
|
|
10
|
+
|
|
11
|
+
|
|
6
12
|
require 'footty'
|
|
7
13
|
|
|
8
14
|
Footty.main
|
|
@@ -110,11 +110,19 @@ module Footty
|
|
|
110
110
|
matches = []
|
|
111
111
|
urls.each do |url|
|
|
112
112
|
txt = get!( url ) ## use "memoized" / cached result
|
|
113
|
-
|
|
114
|
-
matches +=
|
|
113
|
+
doc = Fbtxt::Document.new( txt )
|
|
114
|
+
matches += doc.matches
|
|
115
115
|
### for multiple source file use latest name as "definitive"
|
|
116
|
-
@league_name =
|
|
117
|
-
|
|
116
|
+
@league_name = doc.title || '??'
|
|
117
|
+
|
|
118
|
+
### todo/fix - imrove report errors formula
|
|
119
|
+
if doc.errors?
|
|
120
|
+
puts "!! HTTP ERROR - #{response.status.code} #{response.status.message}"
|
|
121
|
+
exit 1
|
|
122
|
+
puts "!! PARSE - #{doc.errors.size} parse error(s) in >#{url}<:"
|
|
123
|
+
pp doc.errors
|
|
124
|
+
exit 1
|
|
125
|
+
end
|
|
118
126
|
end
|
|
119
127
|
|
|
120
128
|
matches = matches.map {|match| match.as_json } # convert to json
|
data/lib/footty/pp_matches.rb
CHANGED
|
@@ -9,9 +9,40 @@ module Footty
|
|
|
9
9
|
|
|
10
10
|
today = Date.today
|
|
11
11
|
|
|
12
|
+
last_date = nil
|
|
13
|
+
last_round = nil
|
|
14
|
+
|
|
12
15
|
matches.each do |match|
|
|
16
|
+
|
|
17
|
+
## note - merge group into round
|
|
18
|
+
|
|
19
|
+
round = String.new
|
|
20
|
+
round += "#{match['group']}, " if match['group'] ## (optional) group
|
|
21
|
+
round += "#{match['round']}"
|
|
22
|
+
|
|
23
|
+
if last_round.nil? || last_round != round
|
|
24
|
+
print "▪ #{round} ▪\n" ## knock out (k.o.) phase/stage
|
|
25
|
+
last_date = nil
|
|
26
|
+
else
|
|
27
|
+
## print " " + (" " *round.length)
|
|
28
|
+
end
|
|
29
|
+
last_round = round
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
13
35
|
date = match['date']
|
|
14
|
-
|
|
36
|
+
|
|
37
|
+
## do NOT repeat same date
|
|
38
|
+
if last_date.nil? || last_date != date
|
|
39
|
+
print "#{date.strftime('%a %b %d')} " ## e.g. Thu Jun 14
|
|
40
|
+
else
|
|
41
|
+
print " "
|
|
42
|
+
end
|
|
43
|
+
last_date = date
|
|
44
|
+
|
|
45
|
+
|
|
15
46
|
print "#{match['time']} " if match['time']
|
|
16
47
|
|
|
17
48
|
if date > today
|
|
@@ -55,7 +86,7 @@ module Footty
|
|
|
55
86
|
score = "#{match['score'][0]}-#{match['score'][1]}"
|
|
56
87
|
print " #{score} "
|
|
57
88
|
else
|
|
58
|
-
print "
|
|
89
|
+
print " v "
|
|
59
90
|
end
|
|
60
91
|
|
|
61
92
|
if match['team2'].is_a?( Hash )
|
|
@@ -65,20 +96,15 @@ module Footty
|
|
|
65
96
|
end
|
|
66
97
|
|
|
67
98
|
|
|
68
|
-
print "▪" ## note - add round marker!!
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
print " #{match['group']} /" if match['group'] ## (optional) group
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
print " #{match['round']} " ## knock out (k.o.) phase/stage
|
|
75
|
-
|
|
76
99
|
|
|
77
100
|
print "%-5s " % "(\##{match['num']}) " if match['num']
|
|
78
101
|
|
|
79
102
|
print " @ #{match['ground']}" if match['ground']
|
|
80
103
|
|
|
81
104
|
|
|
105
|
+
print " [#{match['status']}]" if match['status']
|
|
106
|
+
|
|
107
|
+
|
|
82
108
|
print "\n"
|
|
83
109
|
|
|
84
110
|
|
data/lib/footty/version.rb
CHANGED
data/lib/footty.rb
CHANGED
metadata
CHANGED
|
@@ -1,31 +1,73 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: footty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2026.
|
|
4
|
+
version: 2026.7.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gerald Bauer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: webget
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: sportdb-parser
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 0.8.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 0.8.0
|
|
13
41
|
- !ruby/object:Gem::Dependency
|
|
14
42
|
name: sportdb-quick
|
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
|
16
44
|
requirements:
|
|
17
45
|
- - ">="
|
|
18
46
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
47
|
+
version: 0.8.0
|
|
20
48
|
type: :runtime
|
|
21
49
|
prerelease: false
|
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
51
|
requirements:
|
|
24
52
|
- - ">="
|
|
25
53
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.
|
|
54
|
+
version: 0.8.0
|
|
27
55
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
56
|
+
name: fbtok
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: fbtxt2json
|
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
|
30
72
|
requirements:
|
|
31
73
|
- - ">="
|
|
@@ -72,7 +114,7 @@ dependencies:
|
|
|
72
114
|
- - "~>"
|
|
73
115
|
- !ruby/object:Gem::Version
|
|
74
116
|
version: '4.2'
|
|
75
|
-
description: footty - football.db command line tool for national & int'l football
|
|
117
|
+
description: footty - football.db command line tool(s) for national & int'l football
|
|
76
118
|
club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)
|
|
77
119
|
email: gerald.bauer@gmail.com
|
|
78
120
|
executables:
|
|
@@ -121,6 +163,6 @@ requirements: []
|
|
|
121
163
|
rubygems_version: 3.5.22
|
|
122
164
|
signing_key:
|
|
123
165
|
specification_version: 4
|
|
124
|
-
summary: footty - football.db command line tool for national & int'l football club
|
|
166
|
+
summary: footty - football.db command line tool(s) for national & int'l football club
|
|
125
167
|
leagues (& cups) from around the world (bonus - incl. world cup, euro and more)
|
|
126
168
|
test_files: []
|