start, added UFC scraper

This commit is contained in:
2024-06-30 15:08:49 -05:00
commit f38a9f9df5
8 changed files with 323 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package main
type Event struct {
Name string `json:"name"`
Location string `json:"location"`
Organization string `json:"organization"`
Image string `json:"image"`
Date int `json:"date"`
Fights []Fight `json:"fights"`
}
type Fight struct {
Weight string `json:"weight"`
FighterA *Fighter `json:"fighter_a"`
FighterB *Fighter `json:"fighter_b"`
}
type Fighter struct {
Name string `json:"name"`
Image string `json:"image"`
Country string `json:"country"`
}
type EventCallback func(e *Event)
type EventScraper func(c EventCallback)
const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
var Scrapers []EventScraper = []EventScraper{
ScrapeUFC,
}