Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Boxrec

Hierarchy

  • Boxrec

Index

Methods

Static getBoutById

  • Makes a request to BoxRec to get information about an individual bout

    Parameters

    • cookieJar: CookieJar
    • eventBoutId: string

    Returns Promise<BoxrecPageEventBout>

Static getBoxerPDF

  • getBoxerPDF(cookieJar: CookieJar, globalId: number, pathToSaveTo?: undefined | string, fileName?: undefined | string): Promise<string>
  • Makes a request to BoxRec to return/save the PDF version of a boxer profile

    Parameters

    • cookieJar: CookieJar
    • globalId: number

      the BoxRec global id of the boxer

    • Optional pathToSaveTo: undefined | string

      directory to save to. if not used will only return data

    • Optional fileName: undefined | string

      file name to save as. Will save as {globalId}.pdf as default. Add .pdf to end of filename

    Returns Promise<string>

Static getBoxerPrint

  • getBoxerPrint(cookieJar: CookieJar, globalId: number, pathToSaveTo?: undefined | string, fileName?: undefined | string): Promise<string>
  • Makes a request to BoxRec to return/save the printable version of a boxer profile

    Parameters

    • cookieJar: CookieJar
    • globalId: number

      the BoxRec global id of the boxer

    • Optional pathToSaveTo: undefined | string

      directory to save to. if not used will only return data

    • Optional fileName: undefined | string

      file name to save as. Will save as {globalId}.html as default. Add .html to end of filename

    Returns Promise<string>

Static getChampions

Static getDate

  • getDate(cookieJar: CookieJar, dateString: string): Promise<BoxrecPageDate>
  • Makes a request to BoxRec to get events/bouts on the particular date

    Parameters

    • cookieJar: CookieJar
    • dateString: string

      date to search for. Format ex. 2012-06-07

    Returns Promise<BoxrecPageDate>

Static getEventById

  • getEventById(cookieJar: CookieJar, eventId: number): Promise<BoxrecPageEvent>
  • Makes a request to BoxRec to retrieve an event by id

    Parameters

    • cookieJar: CookieJar
    • eventId: number

      the event id from BoxRec

    Returns Promise<BoxrecPageEvent>

Static getEventsByLocation

  • getEventsByLocation(cookieJar: CookieJar, params: BoxrecLocationEventParams, offset?: number): Promise<BoxrecPageLocationEvent>
  • Makes a request to BoxRec to list events by location

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecLocationEventParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageLocationEvent>

Static getPeopleByLocation

  • Make a request to BoxRec to search for people by location

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecLocationsPeopleParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageLocationPeople | BoxrecPageLocationBoxer>

Static getPeopleByName

  • Makes a search request to BoxRec to get all people that match that name by using a generator, we're able to prevent making too many calls to BoxRec

    yields

    {BoxrecPageProfileBoxer | BoxrecPageProfileOtherCommon | BoxrecPageProfileEvents | BoxrecPageProfileManager} returns a generator to fetch the next person by ID

    Parameters

    • cookieJar: CookieJar
    • firstName: string

      the person's first name

    • lastName: string

      the person's last name

    • Default value role: BoxrecRole = BoxrecRole.proBoxer

      the role of the person

    • Default value status: BoxrecStatus = BoxrecStatus.all

      whether the person is active in Boxing or not

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns AsyncIterableIterator<BoxrecPageProfileBoxer | BoxrecPageProfileOtherCommon | BoxrecPageProfileEvents | BoxrecPageProfileManager>

Static getPersonById

Static getRatings

  • Makes a request to BoxRec to get a list of ratings/rankings, either P4P or by a single weight class

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecRatingsParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageRatings>

Static getResults

  • Makes a request to BoxRec to get a list of results. Uses same class

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecResultsParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset this search

    Returns Promise<BoxrecPageSchedule>

Static getSchedule

  • Makes a request to BoxRec to get a list of scheduled events

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecScheduleParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageSchedule>

Static getTitleById

  • getTitleById(cookieJar: CookieJar, titleString: string, offset?: number): Promise<BoxrecPageTitle>
  • Makes a request to BoxRec to the specific title URL to get a belt's history

    Parameters

    • cookieJar: CookieJar
    • titleString: string

      in the format of "6/Middleweight" which would be the WBC Middleweight title

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageTitle>

Static getTitles

  • getTitles(cookieJar: CookieJar, params: BoxrecTitlesParams, offset?: number): Promise<any>
  • Makes a request to BoxRec to return scheduled and previous bouts in regards to a belt/division

    Parameters

    Returns Promise<any>

Static getVenueById

  • getVenueById(cookieJar: CookieJar, venueId: number, offset?: number): Promise<BoxrecPageVenue>
  • Makes a request to BoxRec to get the information of a venue

    Parameters

    • cookieJar: CookieJar
    • venueId: number
    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecPageVenue>

Static getWatched

Static login

  • login(username: string, password: string): Promise<CookieJar>
  • Makes a request to BoxRec to log the user in This is required before making any additional calls The session cookie is stored inside this class and lost Note: credentials are sent over HTTP, BoxRec doesn't support HTTPS

    Parameters

    • username: string

      your BoxRec username

    • password: string

      your BoxRec password

    Returns Promise<CookieJar>

    If the response is undefined, you have successfully logged in. Otherwise an error will be thrown

Static search

  • Makes a request to BoxRec to search people by name, role and if they are active Note: currently only supports boxers

    Parameters

    • cookieJar: CookieJar
    • params: BoxrecSearchParams

      params included in this search

    • Default value offset: number = 0

      the number of rows to offset the search

    Returns Promise<BoxrecSearch[]>

Static unwatch

  • unwatch(cookieJar: CookieJar, boxerGlobalId: number): Promise<boolean>
  • Removes the boxer from the users watch list, returns true if they were successfully removed

    Parameters

    • cookieJar: CookieJar
    • boxerGlobalId: number

    Returns Promise<boolean>

Static watch

  • watch(cookieJar: CookieJar, boxerGlobalId: number): Promise<boolean>
  • Adds the boxer to the users watch list, returns true if they were successfully added to the list

    Parameters

    • cookieJar: CookieJar
    • boxerGlobalId: number

    Returns Promise<boolean>

Generated using TypeDoc