Skip to content

Commit 55a77cc

Browse files
committed
2022 data uploaded at home page
1 parent 679b12b commit 55a77cc

File tree

7 files changed

+19019
-7025
lines changed

7 files changed

+19019
-7025
lines changed

merge.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
del data[indexForFirstOrg]
125125
data.insert(indexForFirstOrg, sanitizedOrg)
126126

127-
firstOrgName = dupNames[0];
128-
del dupNames[0];
127+
firstOrgName = dupNames[0]
128+
del dupNames[0]
129129

130130
data[:] = [d for d in data if not d['name'] in dupNames]
131131

scrape.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
from time import sleep
88
from selenium.webdriver.common.by import By
99

10+
# adjust the sleep timers according to your connection speed and run the script
11+
12+
# if you get error for element not found recheck the class names in the website incase they have changed
13+
1014
base="https://summerofcode.withgoogle.com"
1115
data=[]
1216
pg=webdriver.Chrome(executable_path="/Applications/driver/chromedriver")
@@ -25,7 +29,6 @@
2529
if next_page.get_property('disabled'):
2630
break
2731
next_page.click()
28-
# next_page = pg.find_element(By.XPATH, '//button[contains(@class, "mat-focus-indicator mat-tooltip-trigger mat-paginator-navigation-next mat-icon-button mat-button-base")]')
2932
print(next_page.get_property('disabled'))
3033
sleep(2)
3134
soup=BeautifulSoup(pg.page_source,'html5lib')
@@ -37,7 +40,6 @@
3740
for i in range(len(org)):
3841
dic={}
3942
urlo=base+(org[i].attrs['href'])
40-
print(urlo)
4143
pg.get(urlo)
4244
sleep(8)
4345
sp=BeautifulSoup(pg.page_source,'html5lib')
@@ -60,26 +62,20 @@
6062
dic['url']=urlo
6163
dic['name']=sp.find('span','title').string
6264
tech_string = sp.find('div',"tech__content").string
63-
print(tech_string)
6465
tech=tech_string.split(',')
6566
for j in range(len(tech)):
6667
tech[j]=tech[j].strip()
6768
dic['tech']=tech
68-
# cat = sp.find('li', attrs={'class': 'organization__tag organization__tag--category'})
69-
# te=cat.text.replace('\n','')
70-
# te=te.replace('\t','')
7169
dic['cat']=''
7270
topic_string = sp.find('div','topics__content').string
7371
top=topic_string.split(',')
74-
print(top)
7572
for j in range(len(top)):
7673
top[j]=top[j].strip()
7774
dic['top']=top
7875
dic['year']=[year]
7976
proj=sp.find_all('div',"contributor__content")
8077
dic['proj']=[len(proj)]
8178
data.append(dic)
82-
print (data,'oooo')
8379
for year in reversed(range(2009,2016)):
8480
url="https://www.google-melange.com/archive/gsoc/"+str(year)
8581
base="https://www.google-melange.com"
@@ -118,7 +114,6 @@
118114
break
119115
if f==1:d['project'].append(0)
120116
d.pop('proj')
121-
print(data,'lololo')
122117
with open('data.json', 'w') as fout:
123118
json.dump(data , fout,indent = 6)
124119
print(data)
+63-42
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,68 @@
1-
import React from 'react'
2-
import { HorizontalBar, defaults } from 'react-chartjs-2'
3-
import "../../css/graphcss.css"
1+
import React from "react";
2+
import { HorizontalBar, defaults } from "react-chartjs-2";
3+
import "../../css/graphcss.css";
44

55
defaults.global.tooltips.enabled = true;
6-
defaults.global.legend.position = 'bottom';
6+
defaults.global.legend.position = "bottom";
77

88
const OrganizationChart = (props) => {
9-
return (
10-
<div className="gsocChart" id="company">
11-
<HorizontalBar
12-
data={{
13-
labels: ['2010','2011','2012','2013','2014','2015','2016', '2017', '2018', '2019', '2020', '2021'],
14-
datasets: [
15-
{
16-
label: 'Open Source Organizations',
17-
data: [42,102,135,175,150,150,175,180,177,190,134, 178, 198, 206, 201, 199, 199],
18-
backgroundColor: 'rgba(54, 162, 235, 0.2)',
19-
borderColor: 'rgba(54, 162, 235, 1)',
20-
borderWidth: 1,
21-
},
22-
],
23-
}
24-
}
25-
options={{
26-
maintainAspectRatio: false,
27-
scales: {
28-
yAxes: [
29-
{
30-
ticks: {
31-
beginAtZero: true,
32-
},
33-
},
34-
],
35-
},
36-
legend: {
37-
labels: {
38-
fontSize: props.font,
39-
},
40-
},
41-
}}
42-
/>
43-
</div>
44-
)
45-
}
9+
return (
10+
<div className="gsocChart" id="company">
11+
<HorizontalBar
12+
data={{
13+
labels: [
14+
"2005",
15+
"2006",
16+
"2006",
17+
"2008",
18+
"2009",
19+
"2010",
20+
"2011",
21+
"2012",
22+
"2013",
23+
"2014",
24+
"2015",
25+
"2016",
26+
"2017",
27+
"2018",
28+
"2019",
29+
"2020",
30+
"2021",
31+
"2022",
32+
],
33+
datasets: [
34+
{
35+
label: "Open Source Organizations",
36+
data: [
37+
42, 102, 135, 175, 150, 150, 175, 180, 177, 190, 134, 178, 198,
38+
206, 201, 199, 199, 202,
39+
],
40+
backgroundColor: "rgba(54, 162, 235, 0.2)",
41+
borderColor: "rgba(54, 162, 235, 1)",
42+
borderWidth: 1,
43+
},
44+
],
45+
}}
46+
options={{
47+
maintainAspectRatio: false,
48+
scales: {
49+
yAxes: [
50+
{
51+
ticks: {
52+
beginAtZero: true,
53+
},
54+
},
55+
],
56+
},
57+
legend: {
58+
labels: {
59+
fontSize: props.font,
60+
},
61+
},
62+
}}
63+
/>
64+
</div>
65+
);
66+
};
4667

47-
export default OrganizationChart;
68+
export default OrganizationChart;
+73-49
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,78 @@
1-
import React from 'react'
2-
import { Bar, defaults } from 'react-chartjs-2'
3-
import "../../css/graphcss.css"
1+
import React from "react";
2+
import { Bar, defaults } from "react-chartjs-2";
3+
import "../../css/graphcss.css";
44

55
defaults.global.tooltips.enabled = true;
6-
defaults.global.legend.position = 'bottom';
6+
defaults.global.legend.position = "bottom";
77

88
const ParticipantChart = (props) => {
9-
return (
10-
<div className="gsocChart">
11-
<Bar
12-
data={{
13-
labels: ['2010','2011','2012','2013','2014','2015','2016', '2017', '2018', '2019', '2020', '2021'],
14-
datasets: [
15-
{
16-
label: 'No. of Participants accepted',
17-
data: [410,630,905,1126,1000,1026,1115,1212,1192,1307,1051, 1206, 1318, 1264, 1276, 1198, 1292],
18-
backgroundColor: 'rgba(255, 99, 132, 0.2)',
19-
borderColor: 'rgba(255, 99, 132, 1)',
20-
borderWidth: 1,
21-
},
22-
{
23-
label: 'Sucessful participants',
24-
data: [328,516.6,733.05,935,850,913.14,981,1073,1060,1172,927, 1032, 1136, 1090, 1136, 1106, 1205],
25-
backgroundColor: 'orange',
26-
borderColor: 'red',
27-
borderWidth: 1,
28-
},
29-
],
30-
}
31-
}
32-
options={{
33-
maintainAspectRatio: false,
34-
scales: {
35-
yAxes: [
36-
{
37-
ticks: {
38-
beginAtZero: true,
39-
},
40-
},
41-
],
42-
},
43-
legend: {
44-
labels: {
45-
fontSize: props.font ,
46-
}
47-
},
48-
}}
49-
/>
50-
</div>
51-
)
52-
}
9+
return (
10+
<div className="gsocChart">
11+
<Bar
12+
data={{
13+
labels: [
14+
"2005",
15+
"2006",
16+
"2006",
17+
"2008",
18+
"2009",
19+
"2010",
20+
"2011",
21+
"2012",
22+
"2013",
23+
"2014",
24+
"2015",
25+
"2016",
26+
"2017",
27+
"2018",
28+
"2019",
29+
"2020",
30+
"2021",
31+
"2022",
32+
],
33+
datasets: [
34+
{
35+
label: "No. of Participants accepted",
36+
data: [
37+
410, 630, 905, 1126, 1000, 1026, 1115, 1212, 1192, 1307, 1051,
38+
1206, 1318, 1264, 1276, 1198, 1292, 1209,
39+
],
40+
backgroundColor: "rgba(255, 99, 132, 0.2)",
41+
borderColor: "rgba(255, 99, 132, 1)",
42+
borderWidth: 1,
43+
},
44+
{
45+
label: "Sucessful participants",
46+
data: [
47+
328, 516.6, 733.05, 935, 850, 913.14, 981, 1073, 1060, 1172,
48+
927, 1032, 1136, 1090, 1136, 1106, 1205, 1054,
49+
],
50+
backgroundColor: "orange",
51+
borderColor: "red",
52+
borderWidth: 1,
53+
},
54+
],
55+
}}
56+
options={{
57+
maintainAspectRatio: false,
58+
scales: {
59+
yAxes: [
60+
{
61+
ticks: {
62+
beginAtZero: true,
63+
},
64+
},
65+
],
66+
},
67+
legend: {
68+
labels: {
69+
fontSize: props.font,
70+
},
71+
},
72+
}}
73+
/>
74+
</div>
75+
);
76+
};
5377

54-
export default ParticipantChart;
78+
export default ParticipantChart;

0 commit comments

Comments
 (0)