Skip to content

Commit

Permalink
Fix LeetCode API
Browse files Browse the repository at this point in the history
  • Loading branch information
EFanZh committed Mar 23, 2024
1 parent 637d68b commit 37be6c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/progress-tracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workspace = true
[dependencies]
chrono = "*"
git2 = "*"
http = "*"
num = "*"
plotters = "*"
reqwest = { version = "*", features = ["blocking", "json"] }
Expand Down
8 changes: 6 additions & 2 deletions tools/progress-tracker/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use git2::Repository;
use http::header;
use problems::Problems;
use reqwest::blocking;
use reqwest::blocking::Client;
use std::path::Path;
use std::{env, fs};

Expand All @@ -11,7 +12,10 @@ mod report;
mod solutions;

fn get_all_problems() -> Problems {
blocking::get("https://leetcode.com/api/problems/algorithms/")
Client::new()
.get("https://leetcode.com/api/problems/algorithms/")
.header(header::COOKIE, "LEETCODE_SESSION=")
.send()
.unwrap()
.json()
.unwrap()
Expand Down

0 comments on commit 37be6c6

Please sign in to comment.