Skip to content

Commit b6cb6c4

Browse files
Modify distribution of test sites
1 parent 92b5ad3 commit b6cb6c4

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ func talkToServer() {
520520
if updateMasterList() != nil {
521521
log.Println("Error updating server with my blocked list!")
522522
}
523-
time.Sleep(15*time.Second)
523+
time.Sleep(300*time.Second)
524524
}
525525
}
526526

testAccuracy.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ import (
77
"bufio"
88
"strings"
99
"os/exec"
10+
"math"
11+
"time"
1012
)
1113

14+
func exp(x int) float64 {
15+
return 100.0*math.Exp(-0.2*float64(x))
16+
}
17+
1218
func main() {
1319
file, err := os.Open("alexa_top.txt")
1420
if err != nil {
@@ -24,28 +30,28 @@ func main() {
2430
defer output.Close()
2531

2632
scanner := bufio.NewScanner(file)
33+
x := 0
2734
for scanner.Scan() {
2835
line := scanner.Text()
2936
if !strings.Contains(line, "www.") {
3037
line = "www."+line
3138
}
32-
cmd := exec.Command("curl", "-s","--connect-timeout", "5", "-m", "10", line)
33-
err := cmd.Run()
34-
if err != nil {
35-
fmt.Println(line)
36-
output.WriteString(line+": "+err.Error()+"\n")
37-
output.Sync()
39+
copies := exp(x)
40+
for i := 0; i < int(copies); i++ {
41+
cmd := exec.Command("curl", "-s","--connect-timeout", "5", "-m", "10", line)
42+
err := cmd.Run()
43+
if err != nil {
44+
fmt.Println(line)
45+
output.WriteString(line+": "+err.Error()+"\n")
46+
output.Sync()
47+
}
48+
time.Sleep(2 * time.Second)
3849
}
50+
x++
3951
}
4052

4153
if err := scanner.Err(); err != nil {
4254
log.Fatal(err)
4355
}
4456
}
4557

46-
/* Ended at:
47-
* www.w3schools.com
48-
www.11st.co.kr
49-
www.milliyet.com.tr
50-
www.google.dz
51-
*/

0 commit comments

Comments
 (0)