forked from thewisenerd/GSoC_info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetdetails
executable file
·55 lines (36 loc) · 967 Bytes
/
getdetails
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
BASE_DOMAIN="https://www.google-melange.com"
BASE_URL="https://www.google-melange.com/gsoc/projects/list/google/gsoc";
BASE_YEAR=2009
THIS_YEAR=$( date +%Y )
#till google starts accepting more than 2k projects, we shall have it this way
BASE_PARAMS="?fmt=json&limit=2000&idx=0"
LINK_FILE="url"
ABSTRACT_FILE="abstract.txt"
NPROC=0
get_details() {
cd $BASE_YEAR
len=$( ls -l . | grep -c ^d )
COUNTER=0
while [ $COUNTER -lt $len ]; do
BASE_COUNT=`expr ${COUNTER} + 1`
foo="$(printf "%04d" $BASE_COUNT)"
cd $foo
echo "parsing proj: "${BASE_YEAR}"/"${foo}
url_g=$( cat ${LINK_FILE} | sed 's/\"//g' )
NPROC=$(($NPROC+1))
../../gen.py ${BASE_DOMAIN}${url_g} &
#why 7? 7 * (7 - 1) = 42 = answer to life, the universe, et tout
if [ "$NPROC" -ge 7 ]; then
wait
NPROC=0
fi
cd ..
let COUNTER=COUNTER+1
done
cd ..
}
while [ $BASE_YEAR -le $THIS_YEAR ]; do
get_details
let BASE_YEAR=BASE_YEAR+1
done