Remove some comments I left for myself earlier.
This commit is contained in:
@ -22,13 +22,12 @@ type Game struct {
|
|||||||
func getCurrentWeek() int {
|
func getCurrentWeek() int {
|
||||||
startDate, _ := time.Parse("2006-01-02", seasonStartDate)
|
startDate, _ := time.Parse("2006-01-02", seasonStartDate)
|
||||||
weeks := int(time.Since(startDate).Hours() / (24 * 7))
|
weeks := int(time.Since(startDate).Hours() / (24 * 7))
|
||||||
return weeks + 1 // +1 to adjust to the 1-based week number
|
return weeks + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetGameInfo(teamName string) string {
|
func GetGameInfo(teamName string) string {
|
||||||
currentWeek := getCurrentWeek()
|
currentWeek := getCurrentWeek()
|
||||||
|
|
||||||
// Use url.QueryEscape to properly encode team names with special characters
|
|
||||||
encodedTeamName := url.QueryEscape(teamName)
|
encodedTeamName := url.QueryEscape(teamName)
|
||||||
url := fmt.Sprintf("https://api.collegefootballdata.com/games?year=%d&week=%d&team=%s", time.Now().Year(), currentWeek, encodedTeamName)
|
url := fmt.Sprintf("https://api.collegefootballdata.com/games?year=%d&week=%d&team=%s", time.Now().Year(), currentWeek, encodedTeamName)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user