Deleting unwanted scripts and checking in relevant ones.
[pingpong.git] / automation / browser.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Range of random number (in seconds)
7 # Five websites
8 BRO_RAN_STA=0
9 BRO_RAN_END=9
10 # Browsing interval (every 100-500 seconds)
11 SLP_RAN_STA=10
12 SLP_RAN_END=500
13
14 # List of websites
15 WEBSITE[0]="https://www.google.com"
16 WEBSITE[1]="https://www.youtube.com"
17 WEBSITE[2]="https://www.facebook.com"
18 WEBSITE[3]="https://www.amazon.com"
19 WEBSITE[4]="https://www.reddit.com"
20 WEBSITE[5]="https://www.wikipedia.org"
21 WEBSITE[6]="https://www.yahoo.com"
22 WEBSITE[7]="https://twitter.com"
23 WEBSITE[8]="https://www.instagram.com"
24 WEBSITE[9]="https://www.linkedin.com"
25
26 while true
27 do
28         # Choose a website randomly
29         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
30         #RAND=$[`jot -r 1 $BRO_RAN_STA $BRO_RAN_END`]
31         RAND=$[`shuf -i $BRO_RAN_STA-$BRO_RAN_END -n 1`]
32         echo "${WEBSITE[$RAND]}"
33         curl ${WEBSITE[$RAND]}
34         
35         # Sleep with random delay time  
36         #RAND=$[`jot -r 1 $SLP_RAN_STA $SLP_RAN_END`]
37         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
38         RAND=$[`shuf -i $SLP_RAN_STA-$SLP_RAN_END -n 1`]
39         echo "Delay: $RAND seconds"
40         sleep $[$RAND]s
41
42         # pick a prime number > 120 seconds
43         #sleep 131s
44 done
45
46