Comparing version 2.8.0 to 2.8.1
@@ -112,15 +112,20 @@ "use strict"; | ||
if (team1 && team2) { | ||
headToHead = mappers_1.toArray($('.head-to-head-listing tr')).map(function (matchEl) { return ({ | ||
date: Number(matchEl.find('.date a span').attr('data-unix')), | ||
winner: { | ||
name: matchEl.find('.winner .flag').next().text(), | ||
id: Number(matchEl.find('.winner .flag').next().attr('href').split('/')[2]) | ||
}, | ||
event: { | ||
headToHead = mappers_1.toArray($('.head-to-head-listing tr')).map(function (matchEl) { | ||
var date = Number(matchEl.find('.date a span').attr('data-unix')); | ||
var map = matchEl.find('.dynamic-map-name-short').text(); | ||
var isDraw = matchEl.find('.winner').length === 0; | ||
var winner; | ||
if (!isDraw) { | ||
winner = { | ||
name: matchEl.find('.winner .flag').next().text(), | ||
id: Number(matchEl.find('.winner .flag').next().attr('href').split('/')[2]) | ||
}; | ||
} | ||
var event = { | ||
name: matchEl.find('.event a').text(), | ||
id: Number(matchEl.find('.event a').attr('href').split('/')[2]) | ||
}, | ||
map: matchEl.find('.dynamic-map-name-short').text(), | ||
result: matchEl.find('.result').text() | ||
}); }); | ||
}; | ||
var result = matchEl.find('.result').text(); | ||
return { date: date, map: map, winner: winner, event: event, result: result }; | ||
}); | ||
} | ||
@@ -127,0 +132,0 @@ if (team1 && team2) { |
@@ -8,15 +8,15 @@ import HLTVConfig from './models/HLTVConfig'; | ||
id: number; | ||
}) => Promise<FullMatch>; | ||
getMatches: () => Promise<(UpcomingMatch | LiveMatch)[]>; | ||
getMatchesStats: ({ startDate, endDate, matchType, maps }?: import("endpoints/getMatchesStats").GetMatchesStatsParams) => Promise<MatchStats[]>; | ||
}) => Promise<import("models/FullMatch").default>; | ||
getMatches: () => Promise<(import("models/UpcomingMatch").default | import("models/LiveMatch").default)[]>; | ||
getMatchesStats: ({ startDate, endDate, matchType, maps }?: import("endpoints/getMatchesStats").GetMatchesStatsParams) => Promise<import("models/MatchStats").default[]>; | ||
getMatchMapStats: ({ id }: { | ||
id: number; | ||
}) => Promise<FullMatchMapStats>; | ||
getRecentThreads: () => Promise<Thread[]>; | ||
}) => Promise<import("models/FullMatchMapStats").default>; | ||
getRecentThreads: () => Promise<import("models/Thread").default[]>; | ||
getResults: ({ pages }?: { | ||
pages?: number | undefined; | ||
}) => Promise<MatchResult[]>; | ||
}) => Promise<import("models/MatchResult").default[]>; | ||
getStreams: ({ loadLinks }?: { | ||
loadLinks?: boolean | undefined; | ||
}) => Promise<FullStream[]>; | ||
}) => Promise<import("models/FullStream").default[]>; | ||
getTeamRanking: ({ year, month, day, country }?: { | ||
@@ -27,12 +27,12 @@ year?: string | undefined; | ||
country?: string | undefined; | ||
}) => Promise<TeamRanking[]>; | ||
}) => Promise<import("models/TeamRanking").default[]>; | ||
getTeam: ({ id }: { | ||
id: number; | ||
}) => Promise<FullTeam>; | ||
}) => Promise<import("models/FullTeam").default>; | ||
getTeamStats: ({ id }: { | ||
id: number; | ||
}) => Promise<FullTeamStats>; | ||
}) => Promise<import("models/FullTeamStats").default>; | ||
getPlayer: ({ id }: { | ||
id: number; | ||
}) => Promise<FullPlayer>; | ||
}) => Promise<import("models/FullPlayer").default>; | ||
getEvent: ({ id }: { | ||
@@ -46,18 +46,1 @@ id: number; | ||
export { hltvInstance as HLTV }; | ||
import FullMatch from './models/FullMatch'; | ||
import FullMatchMapStats from './models/FullMatchMapStats'; | ||
import FullStream from './models/FullStream'; | ||
import LiveMatch from './models/LiveMatch'; | ||
import LogUpdate from './models/LogUpdate'; | ||
import ScoreboardUpdate from './models/ScoreboardUpdate'; | ||
import TeamRanking from './models/TeamRanking'; | ||
import UpcomingMatch from './models/UpcomingMatch'; | ||
import MatchResult from './models/MatchResult'; | ||
import MatchStats from './models/MatchStats'; | ||
import MatchType from './enums/MatchType'; | ||
import Thread from './models/Thread'; | ||
import Map from './enums/Map'; | ||
import FullTeam from './models/FullTeam'; | ||
import FullTeamStats from './models/FullTeamStats'; | ||
import FullPlayer from './models/FullPlayer'; | ||
export { FullMatch, FullMatchMapStats, Map, FullStream, LiveMatch, LogUpdate, ScoreboardUpdate, TeamRanking, UpcomingMatch, MatchResult, MatchStats, MatchType, Thread, FullTeam, FullTeamStats, FullPlayer }; |
@@ -43,5 +43,1 @@ "use strict"; | ||
exports.default = hltvInstance; | ||
var MatchType_1 = require("./enums/MatchType"); | ||
exports.MatchType = MatchType_1.default; | ||
var Map_1 = require("./enums/Map"); | ||
exports.Map = Map_1.default; |
@@ -6,3 +6,3 @@ import Team from './Team'; | ||
date: number; | ||
winner: Team; | ||
winner?: Team; | ||
event: Event; | ||
@@ -9,0 +9,0 @@ map: MapSlug; |
{ | ||
"name": "hltv", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"description": "The unofficial HLTV Node.js API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -27,2 +27,3 @@ [![Dependency Status](https://david-dm.org/gigobyte/hltv.svg)](https://david-dm.org/gigobyte/hltv) | ||
- [getPlayer](#getplayer) | ||
- [getEvent](#getevent) | ||
- [connectToScorebot](#connecttoscorebot) | ||
@@ -47,3 +48,3 @@ | ||
```javascript | ||
const myHLTV = HLTV.createInstance({hltvUrl: 'my-proxy-server'}) | ||
const myHLTV = HLTV.createInstance({hltvUrl: 'my-proxy-server', loadPage: /* my custom request library */}) | ||
``` | ||
@@ -257,2 +258,20 @@ | ||
### getEvent | ||
Parses the info from the `hltv.org/event/` page | ||
Option | Type | Default value | Description | | ||
:---:|:---:|:---:|:---:| | ||
id | int | - | The event id | ||
```javascript | ||
HLTV.getEvent({id: 3389}).then(res => { | ||
... | ||
}) | ||
``` | ||
**[See schema](https://github.com/gigobyte/HLTV/blob/master/src/models/FullEvent.ts)** | ||
*** | ||
#### connectToScorebot | ||
@@ -259,0 +278,0 @@ |
Sorry, the diff of this file is not supported yet
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
300
167339
2420