Skip to content

Commit

Permalink
Add 'date' for 'getResults.ts' #77
Browse files Browse the repository at this point in the history
  • Loading branch information
gigobyte committed Sep 25, 2018
1 parent 8b25162 commit eafa5b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/endpoints/getResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const getResults = (config: HLTVConfig) => async ({ pages=1 } = {}): Promise<Mat
id: Number((E.popSlashSource(matchEl.find('.event-logo')) as string).split('.')[0])
}

return { id, team1, team2, result, event, map, format, stars }
const date = Number(matchEl.parent().attr('data-zonedgrouping-entry-unix'))

return { id, team1, team2, result, event, map, format, stars, date }
}))
}

Expand Down
3 changes: 2 additions & 1 deletion src/models/MatchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ interface MatchResult {
readonly event: Event,
readonly map?: MapSlug,
readonly result: string,
readonly stars: number
readonly stars: number,
readonly date: number
}

export default MatchResult
6 changes: 3 additions & 3 deletions src/playground.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import HLTV from './index'
// HLTV.getMatch({id: 2325766}).then(res => console.dir(res, {depth: null})).catch(err => console.log(err))
// HLTV.getMatch({id: 2326616}).then(res => console.dir(res, {depth: null})).catch(err => console.log(err))
// HLTV.getMatches().then(res => console.log(res))
// HLTV.getLatestResults({pages: 1}).then(res => console.log(res))
// HLTV.getResults({pages: 1}).then(res => console.log(res))
// HLTV.getStreams({ loadLinks: true }).then(res => console.log(res))
// HLTV.getActiveThreads().then(res => console.log(res))
// HLTV.getTeamRanking().then(res => console.log(res))
Expand All @@ -14,7 +14,7 @@
// HLTV.getMatchesStats({startDate: '2017-07-10', endDate: '2017-07-18'}).then(res => console.log(res.length))
// HLTV.getMatch({id: 2312432}).then(res => console.dir(res, {depth: null})).catch(err => console.log(err))
// HLTV.getMatchMapStats({id: 49968}).then(res => console.dir(res, { depth: null }))
// HLTV.getTeam({id: 7144}).then(res => console.dir(res, { depth: null })).catch(err => console.log(err))
// HLTV.getTeam({id: 6118}).then(res => console.dir(res, { depth: null })).catch(err => console.log(err))
// HLTV.getTeamStats({id: 6669}).then(res => console.dir(res, { depth: null })).catch(err => console.log(err))
// HLTV.getPlayer({id: 9216}).then(res => console.dir(res, { depth: null })).catch(err => console.log(err))
// HLTV.getEvent({id: 3773}).then(res => console.dir(res, { depth: null })).catch(err => console.log(err))

0 comments on commit eafa5b1

Please sign in to comment.