Skip to content

Commit d385842

Browse files
committed
Updated directory structure
1 parent 18f59c8 commit d385842

File tree

2 files changed

+14
-85
lines changed

2 files changed

+14
-85
lines changed

Automation/src/Codeforces_automatic_contest_notifier/codeforces.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// CodeForces - Contest Notifier: This tool first logs in to your CodeForces id and then registers to all the contests available at the moment for you.
2+
// It also scrapes the already registered and upcoming contests' data and notifies you of the dates and time of all contests through a text via Whatsapp Web.
3+
// Tech-Stacks : JavaScript, HTML, CSS, puppeteer
4+
15
const pup = require("puppeteer");
26
let fs = require('fs');
37
let email = ""; //type in your email and password to use automatic contest notifier
@@ -12,22 +16,22 @@ async function main(){
1216
let pages = await browser.pages();// browser ke andar opened tabs ko ek array mien leke aana
1317
tab = pages[0];
1418
await tab.goto(url);
15-
await tab.waitForSelector(".menu-list.main-menu-list",{visible:true});
19+
await tab.waitForSelector(".menu-list.main-menu-list",{visible:true});// wait for a css selector to load on page
1620
let list = await tab.$$(".menu-list.main-menu-list li a");
1721
let contest = list[2];
1822
let contestUrl = await tab.evaluate(function(ele){
1923
return ele.getAttribute("href");
2024
},contest);
21-
await tab.goto("https://codeforces.com"+contestUrl);
25+
await tab.goto("https://codeforces.com"+contestUrl);// goes to codeforces main site
2226
await tab.waitForSelector(".lang-chooser",{visible:true,setTimeout:2000});
2327
let enterRegister = await tab.$$(".lang-chooser a");
2428
let enter = enterRegister[2];
2529
let enterHref = await tab.evaluate(function(ele){
26-
return ele.getAttribute("href");
30+
return ele.getAttribute("href"); // gets hyperlink address
2731
},enter);
2832
await tab.goto("https://codeforces.com"+enterHref);
2933
await tab.waitForSelector("#handleOrEmail",{visible:true,setTimeout:2000});
30-
await tab.type("#handleOrEmail",email);
34+
await tab.type("#handleOrEmail",email); // types in email password asynchronusly
3135
await tab.type("#password",password);
3236
await tab.click("input[value='Login']");
3337
await tab.waitForSelector("div[style='background-color: white;margin:0.3em 3px 0 3px;position:relative;']",{visible:true,setTimeout:2000});
@@ -47,6 +51,7 @@ async function main(){
4751
registerUrls.push("https://codeforces.com"+hrefCalc);
4852
}
4953
else{
54+
//creating data of contests and their timings
5055
let data = {};
5156
let text = await columns[columns.length-2].$(".countdown");
5257
let innerText = await tab.evaluate(function(ele){
@@ -67,6 +72,7 @@ async function main(){
6772
if(month<10){
6873
month="0"+month;
6974
}
75+
//extracting date time etc. from the contest timeline
7076
if(innerText.includes("days")|| innerText.includes("day")){
7177
let numberOfDaysToAdd = parseInt(innerText.split(" ")[0]) ;
7278
//console.log(numberOfDaysToAdd);
@@ -111,13 +117,15 @@ async function main(){
111117
setTimeout(()=>{
112118

113119
},2000);
120+
//goes to whatsapp web to send in notification
114121
await tab.goto("https://web.whatsapp.com/");
115122
await tab.waitForSelector("._13NKt.copyable-text.selectable-text",{visible:true});
116-
await tab.type("._13NKt.copyable-text.selectable-text","Tattu Bear");
117-
await tab.keyboard.press("Enter");
123+
await tab.type("._13NKt.copyable-text.selectable-text","Tattu Bear"); // type in contact name to send in the whatsapp msg
124+
await tab.keyboard.press("Enter"); // keypress
118125
await tab.waitForSelector("div[tabindex='-1']",{visible:true,setTimeout:3000});
119126
let readData = fs.readFileSync("contests.json","utf-8");
120127
let lines = readData.split(",");
128+
//reading the data file to type in contest details
121129
for(let j in lines){
122130
let ans = "";
123131
let chars = lines[j];

Pattern Searching/src/Rabin Karp.cpp

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)