From 66eb11018194798b0564255e9606eeab9ea1fef3 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Mon, 5 Nov 2018 11:35:13 -0800 Subject: [PATCH] Adding a dummy browser script. --- automation/browser.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 automation/browser.sh diff --git a/automation/browser.sh b/automation/browser.sh new file mode 100755 index 0000000..6c51e90 --- /dev/null +++ b/automation/browser.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# This script does clicking action automatically +# We just need to set up the timer duration + +# Range of random number (in seconds) +# Five websites +BRO_RAN_STA=0 +BRO_RAN_END=4 +# Browsing interval (every 100-500 seconds) +SLP_RAN_STA=100 +SLP_RAN_END=500 + +# List of websites +WEBSITE[0]="https://www.google.com" +WEBSITE[1]="https://www.youtube.com" +WEBSITE[2]="https://www.facebook.com" +WEBSITE[3]="https://www.yahoo.com" +WEBSITE[4]="https://www.wikipedia.org" + +while true +do + # Choose a website randomly + #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA] + RAND=$[`jot -r 1 $BRO_RAN_STA $BRO_RAN_END`] + echo "${WEBSITE[$RAND]}" + curl ${WEBSITE[$RAND]} + + # Sleep with random delay time + RAND=$[`jot -r 1 $SLP_RAN_STA $SLP_RAN_END`] + echo "Delay: $RAND seconds" + sleep $[$RAND]s + + # pick a prime number > 120 seconds + #sleep 131s +done + + -- 2.34.1