Skip to content

Commit

Permalink
event and runs sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoishin committed Jun 12, 2024
1 parent 7b5dde5 commit a24a868
Show file tree
Hide file tree
Showing 22 changed files with 7,219 additions and 32 deletions.
15 changes: 15 additions & 0 deletions app/lib/api/gdq-tracker/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import ky from "ky";

import type RunsSample from "./sample/runs.json";

export const gdqTracker = async (trackerId: string) => {
const runsApiUrl = `https://tracker.gamesdonequick.com/tracker/api/v2/events/${trackerId}/runs`;
const runs = await ky.get(runsApiUrl).json<typeof RunsSample>();
return runs.results.map((run) => ({
id: run.id.toString(),
name: run.name,
category: run.category,
playedWith: run.console,
startsAt: new Date(run.starttime),
}));
};
Loading

0 comments on commit a24a868

Please sign in to comment.