-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.sh
132 lines (120 loc) · 5.89 KB
/
index.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
FolderName="cache"
Generatelist(){
echo "Generatelist Start"
mkdir -p $FolderName
bash generateRequest.sh | sed -e '0~5 s/$/\nwait/g;'| sed -e '0~6 s/$/\nsleep 1/g;'| bash
cat $FolderName/reksainfo/* | jq -s 'flatten' > $FolderName/allReksadana.txt
cat $FolderName/allReksadana.txt | jq '[try .[] | {id_reksa: .id , symbol: .symbol,name: .name, type: .type ,robocategory: .robocategory, source: "bibit.id" }]' > $FolderName/reksa.txt
echo "Generatelist End"
}
GenerateFolder(){
echo "GenerateFolder Start"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed "s/^/mkdir -p $FolderName\/product\//"|bash
echo "GenerateFolder End"
}
GenerateProduct(){
#node ReksadanaInfo.js product RD68
echo "GenerateProduct Start"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/node ReksadanaInfo.js product /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateProduct End"
}
GenerateProspectus(){
echo "GenerateProspectus Start"
# node ReksadanaInfo.js prospectus RD68
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js prospectus /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateProspectus End"
}
GenerateFactsheets(){
echo "GenerateFactsheets Start"
# node ReksadanaInfo.js factsheets RD68
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js factsheets /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateFactsheets End"
}
GenerateSimulation(){
echo "GenerateSimulation Start"
# node ReksadanaInfo.js simulation RD68
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js simulation /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateSimulation End"
}
GenerateChart(){
echo "GenerateChart Start"
# node ReksadanaInfo.js chart RD68 1y
#Avail range peroid for method "chart, aum":
#1D,1M,3M,YTD,1Y,3Y,5Y,10Y,ALL
echo "1D"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 1D/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "1M"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 1M/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "3M"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 3M/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "YTD"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ YTD/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "1Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 1Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "3Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 3Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "5Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 5Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "10Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ 10Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "ALL"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js chart /; s/$/ ALL/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateChart End"
}
GenerateAum(){
echo "GenerateAum Start"
# node ReksadanaInfo.js aum RD68 1y
#Avail range peroid for method "chart, aum":
#1D,1M,3M,YTD,1Y,3Y,5Y,10Y,ALL
echo "1D"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 1D/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "1M"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 1M/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "3M"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 3M/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "YTD"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ YTD/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "1Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 1Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "3Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 3Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "5Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 5Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "10Y"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ 10Y/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "ALL"
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js aum /; s/$/ ALL/; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
wait
echo "GenerateAum End"
}
GenerateDividends(){
echo "GenerateDividends Start"
# node ReksadanaInfo.js dividends RD68
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js dividends /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateDividends End"
}
GenerateSwitchables(){
echo "GenerateSwitchables Start"
# node ReksadanaInfo.js switchables RD68
cat $FolderName/allReksadana.txt | jq -r '.[].symbol' | sed 's/^/timeout 15 node ReksadanaInfo.js switchables /; s/$/ \&/' | sed -e '0~20 s/$/\nwait/g;'|bash
echo "GenerateSwitchables End"
}
Generatelist
### UNCOMMENT TO USE FUNCTION ###
#GenerateFolder
#GenerateProduct
#GenerateProspectus
#GenerateFactsheets
#GenerateSimulation
#GenerateChart
#GenerateAum
#GenerateDividends
#GenerateSwitchables