mirror of
https://github.com/Dvorinka/facr-scraper.git
synced 2026-07-29 05:53:49 +00:00
facr link
This commit is contained in:
@@ -197,6 +197,7 @@ func parseCompetitionMatchesFromFotbal(pageURL, clubType, clubName, clubID strin
|
||||
Venue: venue,
|
||||
MatchID: matchID,
|
||||
ReportURL: reportURL,
|
||||
FACRLink: reportURL,
|
||||
})
|
||||
})
|
||||
return matches
|
||||
@@ -288,6 +289,8 @@ func parseCompetitionMatchesFromIS(detailURL, clubType, clubName, clubID string)
|
||||
reportURL = fmt.Sprintf("https://www.fotbal.cz/souteze/zapasy/zapas/%s", matchID)
|
||||
}
|
||||
}
|
||||
// Canonical fotbal.cz link
|
||||
facrLink := reportURL
|
||||
// Filter by club involvement: prefer UUID match, fallback to name matching with simplified token
|
||||
if clubName != "" || clubID != "" {
|
||||
involved := false
|
||||
@@ -321,7 +324,7 @@ func parseCompetitionMatchesFromIS(detailURL, clubType, clubName, clubID string)
|
||||
}
|
||||
homeLogo := getLogo(rawHome, homeID)
|
||||
awayLogo := getLogo(rawAway, awayID)
|
||||
matches = append(matches, Match{DateTime: dt, Home: rawHome, HomeID: homeID, HomeLogoURL: homeLogo, Away: rawAway, AwayID: awayID, AwayLogoURL: awayLogo, Score: score, Venue: venue, MatchID: matchID, ReportURL: func() string { if isReportHref != "" { return isReportHref }; return reportURL }(), DelegationURL: isDelegHref})
|
||||
matches = append(matches, Match{DateTime: dt, Home: rawHome, HomeID: homeID, HomeLogoURL: homeLogo, Away: rawAway, AwayID: awayID, AwayLogoURL: awayLogo, Score: score, Venue: venue, MatchID: matchID, ReportURL: func() string { if isReportHref != "" { return isReportHref }; return reportURL }(), FACRLink: facrLink, DelegationURL: isDelegHref})
|
||||
})
|
||||
if os.Getenv("DEBUG_SAVE_HTML") != "" {
|
||||
log.Printf("IS parse summary for %s: total rows=%d, kept=%d", detailURL, totalRows, keptRows)
|
||||
@@ -1146,6 +1149,7 @@ type Match struct {
|
||||
Note string `json:"note,omitempty"`
|
||||
MatchID string `json:"match_id"`
|
||||
ReportURL string `json:"report_url,omitempty"`
|
||||
FACRLink string `json:"facr_link,omitempty"`
|
||||
DelegationURL string `json:"delegation_url,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user