Skip to content

Commit 4943c57

Browse files
committed
Remove the CLI and make FBD-downloader a library.
1 parent 15045eb commit 4943c57

10 files changed

Lines changed: 60 additions & 58 deletions

File tree

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ go.work.sum
2323

2424
# env file
2525
.env
26-
main.go
26+
27+
# vscode
28+
.vscode/launch.json
29+
30+
# main
31+
cmd/main.go

.vscode/launch.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"request": "launch",
1111
"mode": "auto",
1212
"program": "${fileDirname}",
13+
"env": {
14+
"FBD_USERNAME": "",
15+
"FBD_PASSWORD": "",
16+
},
1317
"args": []
1418
}
1519
]

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# FBD-downloader
2+
3+
Go library for downloading [Football Bet Data](https://www.football-bet-data.com/) exports programmatically.
4+
5+
## Prerequisites
6+
7+
- Go 1.22+
8+
- A valid [Football Bet Data](https://www.football-bet-data.com/) account
9+
10+
## Usage
11+
12+
Install:
13+
14+
```bash
15+
go get github.com/LonecastSystems/FBD-downloader
16+
```
17+
18+
Import the package:
19+
20+
```go
21+
import fbd "github.com/LonecastSystems/FBD-downloader"
22+
```
23+
24+
Basic flow:
25+
26+
```go
27+
client, err := fbd.NewClient()
28+
if err != nil {
29+
// handle error
30+
}
31+
32+
if err := client.SignIn(username, password); err != nil {
33+
// handle error
34+
}
35+
defer client.SignOut()
36+
37+
if err := client.NewDashboardConfigBuilder().
38+
WithMatchesNoPrediction().
39+
WithLeagues(map[fbd.Country][]string{fbd.ENGLAND: {"1", "2"}}).
40+
WithSummerSeasons([]int{2025}).
41+
WithWinterSeasons([]int{2025}).
42+
Build().
43+
ExportToExcel("dashboard.xlsx"); err != nil {
44+
// handle error
45+
}
46+
```
47+
48+
## Notes
49+
50+
- Keep credentials out of source code. Read them from environment variables or your secrets manager.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

main.go

Lines changed: 0 additions & 57 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)