Skip to content

Commit 441b32e

Browse files
authored
Initial Commit
1 parent 83f6ea3 commit 441b32e

18 files changed

Lines changed: 6411 additions & 23 deletions

LICENSE

Lines changed: 674 additions & 21 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# 30daysofgooglecloud-asiet
2-
This is a simple leaderboard for 30 days of Google Cloud program for students of ASIET
1+
# 30daysleaderboard
2+
3+
Update - Now if you run this script it will tell you how many students got atleast 1 skill badge, how many completed atleast 1 track etc
4+
5+
6+
I made this for the program #30DaysofGoogleCloud
7+
8+
For this you need to edit all the Qwiklabs Public URL in the userurl.txt and run publiclistmaker.py to generate all the links in list and update the list in main.py
9+
10+
then after pushing it back to github you need to enable Github Actions from the action tab and then make a commit to start the Github Actions.
11+
It has multi threading support and it scrapes the data in 6 seconds and it will automatically run on github action every 2 hours to scrap the data and generate JSON file.
12+
For hosting use netlify as its free.
13+
14+
Note - Make sure all the Qwiklabs public URL are correct otherwise it will crash.
15+
16+
That's all, it will then automatically scrap the data and update the json file easily every hour.
17+
18+
19+
Thank You

animated_text_fill.png

7.93 KB
Loading

assets/css/index.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
body {
2+
background: #151414;
3+
}
4+
.ani-text{
5+
position: absolute;
6+
top: 50%;
7+
left: 50%;
8+
transform: translate(-50% , -50%);
9+
}
10+
p {
11+
border: 4px double rgba(255, 255, 255, 0.25);
12+
border-width: 4px 0;
13+
padding: 25px 0px 25px 0px ;
14+
}
15+
p span {
16+
font: 700 4em/1 "Oswald", sans-serif;
17+
letter-spacing: 0;
18+
display: block;
19+
margin: 0 auto;
20+
text-shadow: 0 0 80px rgba(255, 255, 255, 0.5);
21+
background: url(animated_text_fill.png) ;
22+
-webkit-background-clip: text;
23+
-webkit-text-fill-color: transparent;
24+
-webkit-animation: slide 80s linear infinite;
25+
-webkit-transform: translate3d(0, 0, 0);
26+
-webkit-backface-visibility: hidden;
27+
}
28+
@-webkit-keyframes slide {
29+
0% {
30+
background-position: 0% 50%;
31+
}
32+
100% {
33+
background-position: 100% 50%;
34+
}
35+
}

assets/img/animated_text_fill.png

7.93 KB
Loading

assets/js/index.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
console.clear();
2+
3+
function getData() {
4+
var xh = new XMLHttpRequest();
5+
xh.open(
6+
"GET",
7+
"my.json",
8+
true
9+
);
10+
xh.setRequestHeader("Content-Type", "application/json");
11+
xh.send();
12+
xh.onload = function () {
13+
if (this.status == 200) {
14+
// // console.log(this.responseText)
15+
var data = JSON.parse(this.responseText);
16+
console.log(data);
17+
18+
var i = 1;
19+
data.forEach(member => {
20+
let newRow = document.createElement('li');
21+
newRow.classList = 'c-list__item';
22+
newRow.innerHTML = `
23+
<div class="c-list__grid">
24+
<div class="c-flag c-place u-bg--transparent">${i}</div>
25+
<div class="c-media">
26+
<img class="c-avatar c-media__img" src="${member.dp}" />
27+
<div class="c-media__content">
28+
<div class="c-media__title">${member.name}</div>
29+
<a class="c-media__link ">Track 1 - ${member.track1}</a>
30+
<br>
31+
<br>
32+
<a class="c-media__link ">Track 2 - ${member.track2}</a>
33+
</div>
34+
</div>
35+
<div class="u-text--right c-kudos">
36+
<div class="u-mt--8">
37+
<strong>${member.qcomplete_no}</strong>
38+
</div>
39+
</div>
40+
</div>
41+
`;
42+
if (i === 1) {
43+
newRow.querySelector('.c-place').classList.add('u-text--dark');
44+
newRow.querySelector('.c-place').classList.add('u-bg--yellow');
45+
newRow.querySelector('.c-kudos').classList.add('u-text--yellow');
46+
} else if (i === 2) {
47+
newRow.querySelector('.c-place').classList.add('u-text--dark');
48+
newRow.querySelector('.c-place').classList.add('u-bg--teal');
49+
newRow.querySelector('.c-kudos').classList.add('u-text--teal');
50+
} else if (i === 3) {
51+
newRow.querySelector('.c-place').classList.add('u-text--dark');
52+
newRow.querySelector('.c-place').classList.add('u-bg--orange');
53+
newRow.querySelector('.c-kudos').classList.add('u-text--orange');
54+
}
55+
i++;
56+
list.appendChild(newRow);
57+
});
58+
59+
60+
61+
62+
} else {
63+
console.log("Something went wrong.")
64+
}
65+
};
66+
}

index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>ASIET | GCP</title>
9+
<link rel="stylesheet" href="style.css">
10+
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
11+
</head>
12+
13+
<body onload="getData()">
14+
<div class="ani-text">
15+
<p class="top-heading">
16+
<span>
17+
30 Days of Google Cloud | ASIET
18+
</span>
19+
</p>
20+
</div>
21+
<div class="header-subtitle">
22+
<a href="https://www.linkedin.com/in/harshitkumar197/" rel="noopener" target="_blank"> Made with <span style="color:#e25555" ></span> By HK </a>
23+
<p class="u-text--right">Auto update every hour</p>
24+
25+
</div>
26+
<div class="l-wrapper">
27+
<div class="c-card">
28+
<div class="c-card__body">
29+
<ul class="c-list" id="list">
30+
<li class="c-list__item">
31+
<div class="c-list__grid">
32+
<div class="u-text--left">Rank</div>
33+
<div class="u-text--center">Name</div>
34+
<div class="u-text--right"># of Quests</div>
35+
</div>
36+
</li>
37+
</ul>
38+
</div>
39+
</div>
40+
</div>
41+
<script src="assets/js/index.js"></script>
42+
</body>
43+
44+
</html>

my.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
beautifulsoup4==4.9.3
2+
certifi==2020.6.20
3+
chardet==3.0.4
4+
fuzzywuzzy==0.18.0
5+
html5lib==1.1
6+
idna==2.10
7+
requests==2.24.0
8+
six==1.15.0
9+
soupsieve==2.0.1
10+
urllib3==1.25.10
11+
webencodings==0.5.1

scripts/commit.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
git config --global user.name "github-actions[bot]"
3+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
4+
git add -A
5+
git commit -m "Update test.txt"
6+
git push

0 commit comments

Comments
 (0)