changes
This commit is contained in:
@@ -10,7 +10,7 @@ templ TemplEventPage(e event.Event, upcoming []event.ListUpcomingEventsRow) {
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width"/>
|
<meta name="viewport" content="width=device-width"/>
|
||||||
<link rel="stylesheet" type="text/css" href="/static/styles.css"/>
|
<link rel="stylesheet" type="text/css" href="/static/styles.css"/>
|
||||||
<title>MMA Schedule</title>
|
<title>{ e.Name }</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="h-screen overflow-scroll bg-neutral-focus fill-neutral-content text-neutral-content">
|
<div class="h-screen overflow-scroll bg-neutral-focus fill-neutral-content text-neutral-content">
|
||||||
|
|||||||
+4
-1
@@ -224,7 +224,7 @@ func ScrapeUFCEvent(client ClientScraper, e *event.Event) error {
|
|||||||
func ScrapeUFCFight(s *goquery.Selection) *event.Fight {
|
func ScrapeUFCFight(s *goquery.Selection) *event.Fight {
|
||||||
fight := event.Fight{}
|
fight := event.Fight{}
|
||||||
|
|
||||||
fight.Weight = strings.Replace(TextContent(s, ".c-listing-fight__class-text"), " Bout", "", -1)
|
fight.Weight = strings.ReplaceAll(TextContent(s, ".c-listing-fight__class-text"), " Bout", "")
|
||||||
fight.FighterA = ScrapeUFCFighter(s, "red")
|
fight.FighterA = ScrapeUFCFighter(s, "red")
|
||||||
fight.FighterB = ScrapeUFCFighter(s, "blue")
|
fight.FighterB = ScrapeUFCFighter(s, "blue")
|
||||||
|
|
||||||
@@ -239,6 +239,9 @@ func ScrapeUFCFighter(s *goquery.Selection, color string) *event.Fighter {
|
|||||||
|
|
||||||
image, exists := s.Find(".c-listing-fight__corner-image--" + color + " img").First().Attr("src")
|
image, exists := s.Find(".c-listing-fight__corner-image--" + color + " img").First().Attr("src")
|
||||||
if exists {
|
if exists {
|
||||||
|
if strings.HasPrefix(image, "/") {
|
||||||
|
image = UFC_URL + image
|
||||||
|
}
|
||||||
fighter.Image = image
|
fighter.Image = image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user