Skip to content

Commit

Permalink
gfg ist time delta removed
Browse files Browse the repository at this point in the history
  • Loading branch information
dashroshan committed Oct 22, 2023
1 parent 21e93ac commit 50d13d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions loops/contests scraping.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ async function hackerEarth() {

// Get contests from GeeksforGeeks
async function geeksforgeeks() {
const res = await axios.get(" https://practiceapi.geeksforgeeks.org/api/vr/events/?page_number=1&sub_type=all&type=contest", headers)
const res = await axios.get("https://practiceapi.geeksforgeeks.org/api/vr/events/?page_number=1&sub_type=all&type=contest", headers)
const futureContests = res.data["results"]["upcoming"];
let processedData = futureContests.map(c => {
let name = c["name"]
let url = "https://practice.geeksforgeeks.org/contest/" + c["slug"]
let start = Math.floor(((new Date(c["start_time"])).getTime() - 19800000) / 1000);
const endTimeSeconds = (new Date(c["end_time"]).getTime() - 19800000) / 1000;
const startTimeSeconds = (new Date(c["start_time"]).getTime() - 19800000) / 1000;
let start = Math.floor(((new Date(c["start_time"])).getTime()) / 1000);
const endTimeSeconds = (new Date(c["end_time"]).getTime()) / 1000;
const startTimeSeconds = (new Date(c["start_time"]).getTime()) / 1000;
let duration = endTimeSeconds - startTimeSeconds;

return { name, url, start, duration };
Expand Down

0 comments on commit 50d13d3

Please sign in to comment.