Skip to content

Commit

Permalink
try using fetch instead?
Browse files Browse the repository at this point in the history
  • Loading branch information
danielzsh committed Feb 28, 2024
1 parent 6bba2c4 commit 04537b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usaco_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ async function addProblem(id: number) {
console.log('Adding problem ', id);
try {
const url = `https://usaco.org/index.php?page=viewproblem2&cpid=${id}`;
const response = await axios.get(url);
const htmlContent: string = response.data;
const response = await (await fetch(url)).text();
const htmlContent: string = response;
const problem = htmlContent.match(/<h2> Problem (\d). (.*) <\/h2>/)!;
const number = problem[1],
title = problem[2];
Expand Down

0 comments on commit 04537b1

Please sign in to comment.