patreon ad
This commit is contained in:
@@ -3,6 +3,7 @@ package webcontroller
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"mime"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -32,14 +33,19 @@ func adType() (i int) {
|
||||
// Intn returns a number up to n, but never n itself. So it get a random 0
|
||||
// or 1 we need to give it n=2. We can use this function to make other
|
||||
// splits like 1/3 1/4, etc
|
||||
// i = rand.Intn(2)
|
||||
i = rand.Intn(2)
|
||||
|
||||
// switch {
|
||||
// case i == 1: // 50% of the traffic
|
||||
return 1 // Amarula
|
||||
// default:
|
||||
// return 0 // A-Ads
|
||||
// }
|
||||
// The return value correstonds to the type of ad shown:
|
||||
// 0: A-ads
|
||||
// 1: Amarulasolutions
|
||||
// 2: Patreon
|
||||
|
||||
switch i {
|
||||
case 0: // 50% of the traffic
|
||||
return 1
|
||||
default:
|
||||
return 2
|
||||
}
|
||||
}
|
||||
|
||||
type viewerData struct {
|
||||
|
Reference in New Issue
Block a user