Comparing version 2.20.5 to 2.21.0
@@ -55,3 +55,3 @@ "use strict"; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
var getMatchInfoRowValues, getPlayerTopStat, m$, matchPageID, matchScore, date, team1, team2, event, teamStatProperties, teamStats, mostXProperties, mostX, overview, playerOverviewStats, playerStats; | ||
var getMatchInfoRowValues, getPlayerTopStat, $, matchPageID, matchScore, date, team1, team2, event, teamStatProperties, teamStats, mostXProperties, mostX, overview, playerOverviewStats, playerStats; | ||
return __generator(this, function (_b) { | ||
@@ -83,25 +83,25 @@ switch (_b.label) { | ||
case 1: | ||
m$ = _b.sent(); | ||
matchPageID = Number(m$('.match-page-link').attr('href').split('/')[2]); | ||
$ = _b.sent(); | ||
matchPageID = Number($('.match-page-link').attr('href').split('/')[2]); | ||
matchScore = [ | ||
Number(m$('.team-left .bold').text()), | ||
Number(m$('.team-right .bold').text()) | ||
Number($('.team-left .bold').text()), | ||
Number($('.team-right .bold').text()) | ||
]; | ||
date = Number(m$('.match-info-box .small-text span').first().attr('data-unix')); | ||
date = Number($('.match-info-box .small-text span').first().attr('data-unix')); | ||
team1 = { | ||
id: Number(m$('.team-left a.block').attr('href').split('/')[3]), | ||
name: m$('.team-left .team-logo').attr('title'), | ||
id: Number($('.team-left a.block').attr('href').split('/')[3]), | ||
name: $('.team-left .team-logo').attr('title'), | ||
score: matchScore[0] | ||
}; | ||
team2 = { | ||
id: Number(m$('.team-right a.block').attr('href').split('/')[3]), | ||
name: m$('.team-right .team-logo').attr('title'), | ||
id: Number($('.team-right a.block').attr('href').split('/')[3]), | ||
name: $('.team-right .team-logo').attr('title'), | ||
score: matchScore[1] | ||
}; | ||
event = { | ||
id: Number(m$('.match-info-box .text-ellipsis') | ||
id: Number($('.match-info-box .text-ellipsis') | ||
.first() | ||
.attr('href') | ||
.split('event=')[1]), | ||
name: m$('.match-info-box .text-ellipsis').first().text() | ||
name: $('.match-info-box .text-ellipsis').first().text() | ||
}; | ||
@@ -111,3 +111,3 @@ teamStatProperties = ['rating', 'firstKills', 'clutchesWon']; | ||
var _a; | ||
return (__assign(__assign({}, res), (_a = {}, _a[prop] = getMatchInfoRowValues(m$, i), _a))); | ||
return (__assign(__assign({}, res), (_a = {}, _a[prop] = getMatchInfoRowValues($, i), _a))); | ||
}, {}); | ||
@@ -124,6 +124,6 @@ mostXProperties = [ | ||
var _a; | ||
return (__assign(__assign({}, res), (_a = {}, _a[prop] = getPlayerTopStat(m$, i), _a))); | ||
return (__assign(__assign({}, res), (_a = {}, _a[prop] = getPlayerTopStat($, i), _a))); | ||
}, {}); | ||
overview = __assign(__assign({}, teamStats), mostX); | ||
playerOverviewStats = mappers_1.toArray(m$('.stats-table tbody tr')).map(function (rowEl) { | ||
playerOverviewStats = mappers_1.toArray($('.stats-table tbody tr')).map(function (rowEl) { | ||
var id = Number(rowEl.find('.st-player a').attr('href').split('/')[3]); | ||
@@ -130,0 +130,0 @@ return { |
@@ -96,3 +96,3 @@ "use strict"; | ||
getMapStat = function (i) { | ||
return Number($($('.tab-content .two-col').find('.cell').get(i)) | ||
return Number($($('.playerpage-container').find('.player-stat').get(i)) | ||
.find('.statsVal') | ||
@@ -99,0 +99,0 @@ .text() |
@@ -5,3 +5,4 @@ import { MatchResult } from '../models/MatchResult'; | ||
declare type GetResultsArguments = { | ||
pages?: number; | ||
startPage?: number; | ||
endPage?: number; | ||
teamID?: number; | ||
@@ -11,3 +12,4 @@ eventID?: never; | ||
} | { | ||
pages?: never; | ||
startPage?: never; | ||
endPage?: never; | ||
teamID?: number; | ||
@@ -17,3 +19,3 @@ eventID?: number; | ||
}; | ||
export declare const getResults: (config: HLTVConfig) => ({ pages, teamID, eventID, contentFilters }: GetResultsArguments) => Promise<MatchResult[]>; | ||
export declare const getResults: (config: HLTVConfig) => ({ startPage, endPage, teamID, eventID, contentFilters }: GetResultsArguments) => Promise<MatchResult[]>; | ||
export {}; |
@@ -43,12 +43,15 @@ "use strict"; | ||
exports.getResults = function (config) { return function (_a) { | ||
var _b = _a.pages, pages = _b === void 0 ? 1 : _b, teamID = _a.teamID, eventID = _a.eventID, _c = _a.contentFilters, contentFilters = _c === void 0 ? [] : _c; | ||
var _b = _a.startPage, startPage = _b === void 0 ? 0 : _b, _c = _a.endPage, endPage = _c === void 0 ? 1 : _c, teamID = _a.teamID, eventID = _a.eventID, _d = _a.contentFilters, contentFilters = _d === void 0 ? [] : _d; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
var matches, _loop_1, i; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
return __generator(this, function (_e) { | ||
switch (_e.label) { | ||
case 0: | ||
if (pages < 1) { | ||
console.error('getLatestResults: pages cannot be less than 1'); | ||
if (startPage < 0) { | ||
console.error('getLatestResults: startPage cannot be less than 0'); | ||
return [2, []]; | ||
} | ||
else if (endPage < 1) { | ||
console.error('getLatestResults: endPage cannot be less than 1'); | ||
} | ||
matches = []; | ||
@@ -105,10 +108,10 @@ _loop_1 = function (i) { | ||
}; | ||
i = 0; | ||
_d.label = 1; | ||
i = startPage; | ||
_e.label = 1; | ||
case 1: | ||
if (!(i < pages)) return [3, 4]; | ||
if (!(i < endPage)) return [3, 4]; | ||
return [5, _loop_1(i)]; | ||
case 2: | ||
_d.sent(); | ||
_d.label = 3; | ||
_e.sent(); | ||
_e.label = 3; | ||
case 3: | ||
@@ -115,0 +118,0 @@ i++; |
@@ -78,3 +78,3 @@ "use strict"; | ||
id: Number(matchEl.find('.team-2').attr('href').split('/')[2]), | ||
name: matchEl.find('span.team-2').text() | ||
name: matchEl.find('a.team-2').text() | ||
}, | ||
@@ -105,3 +105,3 @@ result: matchEl.find('.score-cell').text() | ||
.concat(mappers_1.toArray(e$('.image-and-label[href*="event"]')).map(function (eventEl) { return ({ | ||
name: eventEl.attr('title'), | ||
name: eventEl.find('span').text(), | ||
id: Number(eventEl.attr('href').split('=').pop()) | ||
@@ -108,0 +108,0 @@ }); })); |
import { FullTeamStats } from '../models/FullTeamStats'; | ||
import { HLTVConfig } from '../config'; | ||
export declare const getTeamStats: (config: HLTVConfig) => ({ id }: { | ||
export declare const getTeamStats: (config: HLTVConfig) => ({ id, currentRosterOnly }: { | ||
id: number; | ||
currentRosterOnly?: boolean | undefined; | ||
}) => Promise<FullTeamStats>; |
@@ -43,18 +43,54 @@ "use strict"; | ||
exports.getTeamStats = function (config) { return function (_a) { | ||
var id = _a.id; | ||
var id = _a.id, currentRosterOnly = _a.currentRosterOnly; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
var $, m$, e$, mp$, overviewStats, getOverviewStatByIndex, _b, wins, draws, losses, overview, getContainerByText, getPlayersByContainer, currentLineup, historicPlayers, standins, matches, events, getMapStat, mapStats; | ||
var currentRosterURL, matchesURL, eventsURL, mapsURL, $, getContainerByText, getPlayersByContainer, currentLineup, historicPlayers, standins, m$, e$, mp$, overviewStats, getOverviewStatByIndex, _b, wins, draws, losses, overview, matches, events, getMapStat, mapStats; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/teams/" + id + "/-", config.loadPage)]; | ||
case 0: | ||
currentRosterURL = ''; | ||
matchesURL = ''; | ||
eventsURL = ''; | ||
mapsURL = ''; | ||
return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/teams/" + id + "/-", config.loadPage)]; | ||
case 1: | ||
$ = _c.sent(); | ||
return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/teams/matches/" + id + "/-", config.loadPage)]; | ||
getContainerByText = function (text) { | ||
return $('.standard-headline') | ||
.filter(function (_, el) { return $(el).text() === text; }) | ||
.parent() | ||
.next(); | ||
}; | ||
getPlayersByContainer = function (container) { | ||
return mappers_1.toArray(container.find('.image-and-label')).map(function (playerEl) { return ({ | ||
id: Number(playerEl.attr('href').split('/')[3]), | ||
name: playerEl.find('.text-ellipsis').text() | ||
}); }); | ||
}; | ||
currentLineup = getPlayersByContainer(getContainerByText('Current lineup')); | ||
historicPlayers = getPlayersByContainer(getContainerByText('Historic players')); | ||
standins = getPlayersByContainer(getContainerByText('Standins')); | ||
if (!currentRosterOnly) return [3, 3]; | ||
currentRosterURL = "lineup=" + currentLineup | ||
.map(function (x) { return x.id; }) | ||
.join('&lineup=') + "&minLineupMatch=0"; | ||
matchesURL = config.hltvUrl + "/stats/lineup/matches?" + currentRosterURL; | ||
eventsURL = config.hltvUrl + "/stats/lineup/events?" + currentRosterURL; | ||
mapsURL = config.hltvUrl + "/stats/lineup/maps?" + currentRosterURL; | ||
return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/lineup?" + currentRosterURL, config.loadPage)]; | ||
case 2: | ||
$ = _c.sent(); | ||
return [3, 4]; | ||
case 3: | ||
matchesURL = config.hltvUrl + "/stats/teams/matches/" + id + "/-"; | ||
eventsURL = config.hltvUrl + "/stats/teams/events/" + id + "/-"; | ||
mapsURL = config.hltvUrl + "/stats/teams/maps/" + id + "/-"; | ||
_c.label = 4; | ||
case 4: return [4, mappers_1.fetchPage("" + matchesURL, config.loadPage)]; | ||
case 5: | ||
m$ = _c.sent(); | ||
return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/teams/events/" + id + "/-", config.loadPage)]; | ||
case 3: | ||
return [4, mappers_1.fetchPage("" + eventsURL, config.loadPage)]; | ||
case 6: | ||
e$ = _c.sent(); | ||
return [4, mappers_1.fetchPage(config.hltvUrl + "/stats/teams/maps/" + id + "/-", config.loadPage)]; | ||
case 4: | ||
return [4, mappers_1.fetchPage("" + mapsURL, config.loadPage)]; | ||
case 7: | ||
mp$ = _c.sent(); | ||
@@ -78,17 +114,2 @@ overviewStats = $('.standard-box .large-strong'); | ||
}; | ||
getContainerByText = function (text) { | ||
return $('.standard-headline') | ||
.filter(function (_, el) { return $(el).text() === text; }) | ||
.parent() | ||
.next(); | ||
}; | ||
getPlayersByContainer = function (container) { | ||
return mappers_1.toArray(container.find('.image-and-label')).map(function (playerEl) { return ({ | ||
id: Number(playerEl.attr('href').split('/')[3]), | ||
name: playerEl.find('.text-ellipsis').text() | ||
}); }); | ||
}; | ||
currentLineup = getPlayersByContainer(getContainerByText('Current lineup')); | ||
historicPlayers = getPlayersByContainer(getContainerByText('Historic players')); | ||
standins = getPlayersByContainer(getContainerByText('Standins')); | ||
matches = mappers_1.toArray(m$('.stats-table tbody tr')).map(function (matchEl) { return ({ | ||
@@ -111,3 +132,4 @@ dateApproximate: mappers_1.getTimestamp(matchEl.find('.time a').text()), | ||
event: { | ||
id: Number(eventEl.find('.image-and-label').first().attr('href').split('=')[1]), | ||
id: Number(eventEl.find('.image-and-label').first().attr('href').split('=')[eventEl.find('.image-and-label').first().attr('href').split('=') | ||
.length - 1]), | ||
name: eventEl.find('.image-and-label span').first().text() | ||
@@ -114,0 +136,0 @@ } |
@@ -32,4 +32,5 @@ import { HLTVConfig } from './config'; | ||
getRecentThreads: () => Promise<import("./models/Thread").Thread[]>; | ||
getResults: ({ pages, teamID, eventID, contentFilters }: { | ||
pages?: number | undefined; | ||
getResults: ({ startPage, endPage, teamID, eventID, contentFilters }: { | ||
startPage?: number | undefined; | ||
endPage?: number | undefined; | ||
teamID?: number | undefined; | ||
@@ -39,3 +40,4 @@ eventID?: undefined; | ||
} | { | ||
pages?: undefined; | ||
startPage?: undefined; | ||
endPage?: undefined; | ||
teamID?: number | undefined; | ||
@@ -57,4 +59,5 @@ eventID?: number | undefined; | ||
}) => Promise<import("./models/FullTeam").FullTeam>; | ||
getTeamStats: ({ id }: { | ||
getTeamStats: ({ id, currentRosterOnly }: { | ||
id: number; | ||
currentRosterOnly?: boolean | undefined; | ||
}) => Promise<import("./models/FullTeamStats").FullTeamStats>; | ||
@@ -74,2 +77,3 @@ getPlayer: ({ id }: { | ||
}) => Promise<import("./models/EventResult").EventResult[]>; | ||
getOngoingEvents: () => Promise<import("./models/OngoingEventResult").OngoingEventResult[]>; | ||
getPlayerStats: ({ id, startDate, endDate, matchType, rankingFilter }: { | ||
@@ -76,0 +80,0 @@ id: number; |
@@ -41,2 +41,3 @@ "use strict"; | ||
var getEvents_1 = require("./endpoints/getEvents"); | ||
var getOngoingEvents_1 = require("./endpoints/getOngoingEvents"); | ||
var mappers_1 = require("./utils/mappers"); | ||
@@ -62,2 +63,3 @@ var HLTVFactory = (function () { | ||
this.getEvents = getEvents_1.getEvents(this.config); | ||
this.getOngoingEvents = getOngoingEvents_1.getOngoingEvents(this.config); | ||
this.getPlayerStats = getPlayerStats_1.getPlayerStats(this.config); | ||
@@ -64,0 +66,0 @@ this.getPlayerRanking = getPlayerRanking_1.getPlayerRanking(this.config); |
@@ -1,2 +0,2 @@ | ||
/// <reference types="cheerio" /> | ||
import * as cheerio from 'cheerio'; | ||
import { Team } from '../models/Team'; | ||
@@ -10,7 +10,7 @@ import { Veto } from '../models/Veto'; | ||
export declare const defaultLoadPage: (httpAgent: HttpsAgent | HttpAgent | undefined) => (url: string) => Promise<string>; | ||
export declare const fetchPage: (url: string, loadPage?: ((url: string) => Promise<string>) | undefined) => Promise<CheerioStatic>; | ||
export declare const toArray: (elements: Cheerio) => Cheerio[]; | ||
export declare const fetchPage: (url: string, loadPage?: ((url: string) => Promise<string>) | undefined) => Promise<cheerio.Root>; | ||
export declare const toArray: (elements: cheerio.Cheerio) => cheerio.Cheerio[]; | ||
export declare const getMapSlug: (map: string) => MapSlug; | ||
export declare const mapVetoElementToModel: (el: Cheerio, team1: Team, team2: Team) => Veto; | ||
export declare const getMatchPlayer: (playerEl: Cheerio) => Player; | ||
export declare const mapVetoElementToModel: (el: cheerio.Cheerio, team1: Team, team2: Team) => Veto; | ||
export declare const getMatchPlayer: (playerEl: cheerio.Cheerio) => Player; | ||
export declare const getMatchFormatAndMap: (mapText: string) => { | ||
@@ -20,3 +20,3 @@ map?: MapSlug; | ||
}; | ||
export declare const mapRoundElementToModel: (team1Id: number, team2Id: number) => (el: Cheerio, i: number, allRoundEls: Cheerio[]) => WeakRoundOutcome; | ||
export declare const mapRoundElementToModel: (team1Id: number, team2Id: number) => (el: cheerio.Cheerio, i: number, allRoundEls: cheerio.Cheerio[]) => WeakRoundOutcome; | ||
export declare const getTimestamp: (source: string) => number; |
/// <reference types="cheerio" /> | ||
export declare const text: (el: Cheerio) => string; | ||
export declare const prev: (el: Cheerio) => Cheerio; | ||
export declare const hasChild: (childSelector: string) => (el: Cheerio) => boolean; | ||
export declare const hasNoChild: (childSelector: string) => (el: Cheerio) => boolean; | ||
export declare const popSlashSource: (el: Cheerio) => string | undefined; | ||
export declare const text: (el: cheerio.Cheerio) => string; | ||
export declare const prev: (el: cheerio.Cheerio) => cheerio.Cheerio; | ||
export declare const hasChild: (childSelector: string) => (el: cheerio.Cheerio) => boolean; | ||
export declare const hasNoChild: (childSelector: string) => (el: cheerio.Cheerio) => boolean; | ||
export declare const popSlashSource: (el: cheerio.Cheerio) => string | undefined; | ||
export declare const percentageToDecimalOdd: (odd: number) => number; |
@@ -12,5 +12,7 @@ "use strict"; | ||
}; }; | ||
exports.popSlashSource = function (el) { return el.attr('src').split('/').pop(); }; | ||
exports.popSlashSource = function (el) { | ||
return el.attr('src').split('/').pop(); | ||
}; | ||
exports.percentageToDecimalOdd = function (odd) { | ||
return parseFloat(((1 / odd) * 100).toFixed(2)); | ||
}; |
{ | ||
"name": "hltv", | ||
"version": "2.20.5", | ||
"version": "2.21.0", | ||
"description": "The unofficial HLTV Node.js API", | ||
@@ -47,7 +47,7 @@ "main": "lib/index.js", | ||
"@types/socket.io-client": "^1.4.32", | ||
"jest": "^25.1.0", | ||
"jest": "26.6.1", | ||
"prettier": "^2.0.1", | ||
"ts-jest": "^25.0.0", | ||
"ts-jest": "26.4.3", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^3.5.2" | ||
"typescript": "4.0.5" | ||
}, | ||
@@ -54,0 +54,0 @@ "dependencies": { |
@@ -31,2 +31,3 @@ [![Dependency Status](https://david-dm.org/gigobyte/hltv.svg)](https://david-dm.org/gigobyte/hltv) | ||
- [getPlayerRanking](#getplayerranking) | ||
- [getOngoingEvents](#getOngoingEvents) | ||
- [getEvents](#getevents) | ||
@@ -44,3 +45,3 @@ - [getEvent](#getevent) | ||
Please use with caution and try to limit the rate and amount of your requests if you value your access to HLTV. | ||
Please use with caution and try to limit the rate and amount of your requests if you value your access to HLTV. Each method has the number of requests it makes to HLTV documented in this README. This is important if you want to implement some kind of throttling yourself. | ||
@@ -76,3 +77,3 @@ ```javascript | ||
Parses most information from a match page | ||
Parses most information from a match page (1 request) | ||
@@ -95,3 +96,3 @@ | Option | Type | Default value | Description | | ||
Parses all matches from the `hltv.org/matches/` page | ||
Parses all matches from the `hltv.org/matches/` page (1 request) | ||
@@ -116,3 +117,3 @@ | Option | Type | Default Value | Description | | ||
Parses all matches from the `hltv.org/stats/matches` page | ||
Parses all matches from the `hltv.org/stats/matches` page (1 request per page of results) | ||
@@ -138,3 +139,3 @@ | Option | Type | Default Value | Description | | ||
Parses info from the all maps stats page (`hltv.org/stats/matches/*/*`) | ||
Parses info from the `hltv.org/stats/matches/*/*` all maps stats page (1 request) | ||
@@ -157,3 +158,3 @@ | Option | Type | Default Value | Description | | ||
Parses info from the single map stats page (`hltv.org/stats/matches/mapstatsid/*/*`) | ||
Parses info from the `hltv.org/stats/matches/mapstatsid/*/*` single map stats page (2 requests) | ||
@@ -176,15 +177,16 @@ | Option | Type | Default Value | Description | | ||
Parses all matches from the `hltv.org/results/` page | ||
Parses all matches from the `hltv.org/results/` page (1 reuest per result page) | ||
| Option | Type | Default Value | Description | | ||
| :------------: | :-----------------------------------------------------------------------------------------: | :-----------: | :---------------------------------------: | | ||
| pages | number | 1 | Number of pages with results to be parsed | | ||
| teamID | number? | - | ID of specific team | | ||
| eventID | number? | - | ID of specific event | | ||
| contentFilters | [ContentFilter[]](https://github.com/gigobyte/HLTV/blob/master/src/enums/ContentFilter.ts)? | [] | Add filter of the content | | ||
| Option | Type | Default Value | Description | | ||
| :------------: | :-----------------------------------------------------------------------------------------: | :-----------: | :-----------------------: | | ||
| startPage | number | 0 | Set start page | | ||
| endPage | number | 1 | Set end page | | ||
| teamID | number? | - | ID of specific team | | ||
| eventID | number? | - | ID of specific event | | ||
| contentFilters | [ContentFilter[]](https://github.com/gigobyte/HLTV/blob/master/src/enums/ContentFilter.ts)? | [] | Add filter of the content | | ||
```javascript | ||
// Note: if you pass `eventID` to getResults you cannot pass a `pages` parameter | ||
// Note: if you pass `eventID` to getResults you cannot pass the `startpage` and `endPage` parameter | ||
// since HLTV doesn't have pages for the event filter. | ||
HLTV.getResults({pages: 2}).then((res) => { | ||
HLTV.getResults({startPage:0,endPage:2}).then((res) => { | ||
... | ||
@@ -200,7 +202,7 @@ }) | ||
Parses all streams present on the front page of HLTV | ||
Parses all streams present on the front page of HLTV (1 request + 1 request per stream if `loadLinks` is true) | ||
| Option | Type | Default Value | Description | | ||
| :-------: | :-----: | :-----------: | :--------------------------------------------------------------------------------------------------------------------------: | | ||
| loadLinks | boolean | false | Enables parsing of the stream links. Its an option since it can slow down the response (every stream is a separate request). | | ||
| Option | Type | Default Value | Description | | ||
| :-------: | :-----: | :-----------: | :-----------------------------------------------------------------------------------: | | ||
| loadLinks | boolean | false | Enables parsing of the stream links (every stream is an additional separate request). | | ||
@@ -219,3 +221,3 @@ ```javascript | ||
Parses the latest threads on the front page of HLTV | ||
Parses the latest threads on the front page of HLTV (1 request) | ||
@@ -236,3 +238,3 @@ | Option | Type | Default Value | Description | | ||
Parses the info from the `hltv.org/ranking/teams/` page | ||
Parses the info from the `hltv.org/ranking/teams/` page (1 request) | ||
@@ -261,3 +263,3 @@ | Option | Type | Default Value | Description | | ||
Parses the info from the `hltv.org/team/` page | ||
Parses the info from the `hltv.org/team/` page (2 requests) | ||
@@ -280,7 +282,8 @@ | Option | Type | Default value | Description | | ||
Parses the info from the `hltv.org/stats/teams/` page | ||
Parses the info from the `hltv.org/stats/teams/*` page (4 requests + 1 more if `currentRosterOnly` is true) | ||
| Option | Type | Default value | Description | | ||
| :----: | :----: | :-----------: | :---------: | | ||
| id | number | - | The team id | | ||
| Option | Type | Default value | Description | | ||
| :---------------: | :------: | :-----------: | :----------------------------------------: | | ||
| id | number | - | The team id | | ||
| currentRosterOnly | boolean? | false | Return stats about the current roster only | | ||
@@ -299,3 +302,3 @@ ```javascript | ||
Parses the info from the `hltv.org/player/` page | ||
Parses the info from the `hltv.org/player/*` page (1 request) | ||
@@ -318,3 +321,3 @@ | Option | Type | Default value | Description | | ||
Same as getPlayer but accepts a player name instead of ID. | ||
Same as getPlayer but accepts a player name instead of ID. (2 requests) | ||
@@ -335,3 +338,3 @@ | Option | Type | Default value | Description | | ||
Parses the info from `hltv.org/stats/players/*` | ||
Parses the info from `hltv.org/stats/players/*` (1 request) | ||
@@ -358,3 +361,3 @@ | Option | Type | Default value | Description | | ||
Parses the info from `hltv.org/stats/players` page | ||
Parses the info from `hltv.org/stats/players` page (1 request) | ||
@@ -381,3 +384,3 @@ | Option | Type | Default value | Description | | ||
Parses the info from the `hltv.org/events` page | ||
Parses the info from the `hltv.org/events` page (1 request) | ||
@@ -398,5 +401,23 @@ | Option | Type | Default value | Description | | ||
### getOngoingEvents | ||
Parses the info from the `hltv.org/events` page (1 request) | ||
| Option | Type | Default value | Description | | ||
| :----: | :--: | :-----------: | :---------: | | ||
| - | - | - | - | | ||
```javascript | ||
HLTV.getOngoingEvents().then(res => { | ||
... | ||
}) | ||
``` | ||
**[See schema](https://github.com/gigobyte/HLTV/blob/master/src/models/OngoingEventResult.ts)** | ||
--- | ||
### getEvent | ||
Parses the info from the `hltv.org/event/` page | ||
Parses the info from the `hltv.org/event/` page (1 request) | ||
@@ -403,0 +424,0 @@ | Option | Type | Default value | Description | |
@@ -23,3 +23,3 @@ { | ||
}, | ||
"exclude": ["__tests__", "node_modules/**/*", "src/playground.ts"] | ||
"exclude": ["__tests__", "node_modules/**/*", "src/playground.ts"], | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206015
141
3737
444