Wrapper of the most famous MMA website - Sherdog - written in Go.
go get -u github.com/gusandrioli/go-sherdog
package main
import (
"fmt"
"log"
sherdog "github.com/gusandrioli/go-sherdog"
)
func main() {
darrenTill, err := sherdog.FindFighterByID("Darren-Till-73436")
if err != nil {
log.Fatal(err)
}
fmt.Println(darrenTill.Nickname)
}
// Present
func FindAssociationByName(name string) ([]*Association, error)
func FindFighterByID(fighterID FighterID) (*Fighter, error)
func FindFighterByName(name string) ([]*Fighter, error)
func FindOrganizationByID(organizationID OrganizationID) (*Organization, error)
func FindOrganizationByName(name string) ([]*Organization, error)
func FindUpcomingEventsByOrganization(organizationID OrganizationID) ([]*Event, error)
// Upcoming... (subject to change)
func FindAllUpcomingEvents() []*Event
{
Age: "28",
Association: "Astra Fight TeamTeam Kaobon",
Birthday: "1992-12-24",
ProFightHistory: []*Fight{
{
Date: "2020-07-25",
Event: "UFC on ESPN 14 - Whittaker vs. Till",
Method: "Decision (Unanimous)",
Opponent: "Robert Whittaker",
Referee: "Herb Dean",
Result: "loss",
Round: "5",
Time: "5:00",
},
...
},
Height: "6'0\"",
ID: "Darren-Till-73436",
ImageURL: "https://sherdog.com/image_crop/200/300/_images/fighter/1601316708Darren_Till.jpg",
Locality: "Liverpool, Merseyside",
Name: "Darren Till",
Nickname: "The Gorilla",
Record: Record{
LossesDecisions: 1,
LossesKnockouts: 1,
LossesSubmissions: 1,
LossesTotal: 3,
NoContests: 1,
WinsDecisions: 6,
WinsKnockouts: 10,
WinsSubmissions: 2,
WinsTotal: 18,
},
Nationality: "England",
Weight: "185 lbs",
WeightClass: "Middleweight",
}
Bugs or suggestions? Open an issue here.
This project uses Colly for scraping.