Options
All
  • Public
  • Public/Protected
  • All
Menu

boxrec

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

RatingsColumns

RatingsColumns: "name" | "points" | "rating" | "age" | "career" | "record" | "stance" | "residence" | "division" | "last 6" | "ranking"

Stance

Stance: "orthodox" | "southpaw"

Variables

Const $

$: CheerioStatic = cheerio

Const profileTableEl

profileTableEl: string = ".profileTable"

Const ratingsTableEl

ratingsTableEl: string = "#ratingsResults"

Const townRegionCountryRegex

townRegionCountryRegex: RegExp = /\?country=([A-Za-z]+)(?:(?:&|&)region=([A-Za-z0-9]*))?(?:(?:&|&)town=(\d+))?/

Functions

changeToCamelCase

  • changeToCamelCase(str: string): string
  • Changes a string to camelCase

    example

    "foo bar" becomes "fooBar"

    Parameters

    • str: string

    Returns string

convertFractionsToNumber

  • convertFractionsToNumber(fraction: string): number
  • Converts fractional symbols into decimals

    Parameters

    • fraction: string

    Returns number

getColumnData

  • getColumnData($: CheerioStatic, nthChild: number, returnHTML?: boolean): string
  • Used to retrieve data from individual table columns

    Parameters

    • $: CheerioStatic

      requires that the CheerioApi object be passed in

    • nthChild: number

      the column number starting at 1

    • Default value returnHTML: boolean = true

      if true, the HTML will be returned, otherwise just text with HTML removed

    Returns string

Const getLocationValue

  • getLocationValue(href: string, type: "town" | "region" | "country"): string | number | null
  • Parameters

    • href: string
    • type: "town" | "region" | "country"

    Returns string | number | null

Const parseHeight

  • parseHeight(height: string | void): number[] | null
  • Parameters

    • height: string | void

    Returns number[] | null

Const replaceWithWeight

  • replaceWithWeight(str: string): string

Const stripCommas

  • stripCommas(str: string): string
  • Strips the commas out of a string. Used for strings that are large numbers

    Parameters

    • str: string

    Returns string

trimRemoveLineBreaks

  • trimRemoveLineBreaks(str: string): string
  • Removes whitespace at the start and end of the string, remove line breaks and removes occurrences where multiple spaces occur

    Parameters

    • str: string

    Returns string

Const whatTypeOfLink

  • whatTypeOfLink(href: string): "town" | "region" | "country"
  • Parameters

    • href: string

    Returns "town" | "region" | "country"

Object literals

Const beltOrganizations

beltOrganizations: object

BoxRec

BoxRec: null = null

IBF

IBF: null = null

IBO

IBO: null = null

WBA

WBA: null = null

WBC

WBC: null = null

WBO

WBO: null = null

Const emptyLocationObject

emptyLocationObject: object

location

location: object

country

country: object

id

id: null = null

name

name: null = null

region

region: object

id

id: null = null

name

name: null = null

town

town: object

id

id: null = null

name

name: null = null

venue

venue: object

id

id: null = null

name

name: null = null

Const weightDivisions

weightDivisions: object

bantamweight

bantamweight: BoxrecBelts = beltOrganizations

cruiserweight

cruiserweight: BoxrecBelts = beltOrganizations

featherWeight

featherWeight: BoxrecBelts = beltOrganizations

flyweight

flyweight: BoxrecBelts = beltOrganizations

heavyweight

heavyweight: BoxrecBelts = beltOrganizations

lightFlyweight

lightFlyweight: BoxrecBelts = beltOrganizations

lightHeavyweight

lightHeavyweight: BoxrecBelts = beltOrganizations

lightweight

lightweight: BoxrecBelts = beltOrganizations

middleweight

middleweight: BoxrecBelts = beltOrganizations

minimumweight

minimumweight: BoxrecBelts = beltOrganizations

superBantamweight

superBantamweight: BoxrecBelts = beltOrganizations

superFeatherweight

superFeatherweight: BoxrecBelts = beltOrganizations

superFlyweight

superFlyweight: BoxrecBelts = beltOrganizations

superLightweight

superLightweight: BoxrecBelts = beltOrganizations

superMiddleweight

superMiddleweight: BoxrecBelts = beltOrganizations

superWelterweight

superWelterweight: BoxrecBelts = beltOrganizations

welterweight

welterweight: BoxrecBelts = beltOrganizations

Generated using TypeDoc