From ec639d9518770465ef6ae1eed4a9f9cd2233f561 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Fri, 3 Sep 2021 17:57:12 +0200 Subject: [PATCH] Add pixfuture --- res/static/ads.txt | 175 +++++++++++++++++++++++++++++++ res/template/advertisements.html | 34 ++++-- webcontroller/file_preview.go | 2 +- webcontroller/file_viewer.go | 28 +++-- 4 files changed, 222 insertions(+), 17 deletions(-) diff --git a/res/static/ads.txt b/res/static/ads.txt index 897f8d2..efa185b 100644 --- a/res/static/ads.txt +++ b/res/static/ads.txt @@ -880,3 +880,178 @@ criteo.com, b-060278, DIRECT, 9fac4a4a87c2a44f spotxchange.com, 315414, RESELLER, 7842df1d2fe2db34 spotx.tv, 315414, RESELLER, 7842df1d2fe2db34 onetag.com, 719896833a6692c, DIRECT + +#pixfuture START updated Aug-3-2021 +pixfuture.com, 4605, DIRECT +contextweb.com, 548938, DIRECT, 89ff185a4c4e857c +adtech.com, 9834, DIRECT +aolcloud.net, 9834, DIRECT +advertising.com, 24140, DIRECT +aolcloud.net, 24140, DIRECT +coxmt.com, 2000067907202, RESELLER +pubmatic.com, 156078, RESELLER, 5d62403b186f2ace +pubmatic.com, 156377, RESELLER, 5d62403b186f2ace +pubmatic.com, 155967, RESELLER, 5d62403b186f2ace +openx.com, 537143344, RESELLER, 6a698e2ec38604c6 +indexexchange.com, 175407, RESELLER, 50b1c356f2c5c8fc +openx.com, 537125356, RESELLER, 6a698e2ec38604c6 +indexexchange.com, 183965, RESELLER, 50b1c356f2c5c8fc +pubmatic.com, 156458, RESELLER, 5d62403b186f2ace +pubmatic.com, 156325, RESELLER, 5d62403b186f2ace +pubmatic.com, 156084, RESELLER, 5d62403b186f2ace +coxmt.com, 2000067995202, RESELLER +rubiconproject.com, 18222, RESELLER, 0bfd66d529a55807 +google.com, pub-1575911585432548, DIRECT, f08c47fec0942fa0 +spotxchange.com, 226725, DIRECT, 7842df1d2fe2db34 +spotx.tv, 226725, DIRECT, 7842df1d2fe2db34 +openx.com, 540406323, DIRECT, 6a698e2ec38604c6 +appnexus.com, 9982, DIRECT, f5ab79cb980f11d1 +contextweb.com, 561987, DIRECT, 89ff185a4c4e857c +lockerdome.com, 11716509856893696, DIRECT +gumgum.com, 13753, DIRECT, ffdef49475d318a9 +appnexus.com, 1001, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1942, RESELLER, f5ab79cb980f11d1 +appnexus.com, 2758, RESELLER, f5ab79cb980f11d1 +appnexus.com, 3135, RESELLER, f5ab79cb980f11d1 +bidtellect.com, 1407, RESELLER, 1c34aa2d85d45e93 +contextweb.com, 558355, RESELLER, 89ff185a4c4e857c +criteo.com, 109412, DIRECT, 9fac4a4a87c2a44f +openx.com, 537120563, RESELLER, 6a698e2ec38604c6 +openx.com, 537149485, RESELLER, 6a698e2ec38604c6 +pubmatic.com, 50758, RESELLER, 5d62403b186f2ace +spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 +google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 +google.com, pub-3848273848634341, RESELLER, f08c47fec0942fa0 +rhythmone.com, 78519861, RESELLER, a670c89d4a324e47 +outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER +outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, DIRECT +appnexus.com, 7597,RESELLER, f5ab79cb980f11d1 +lkqd.com, 470, RESELLER, 59c49fa9598a0117 +lkqd.net, 470, RESELLER, 59c49fa9598a0117 +33across.com, 0013300001r0t9mAAA, RESELLER +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace +openx.com, 539392223, RESELLER, 6a698e2ec38604c6 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f +pubmatic.com, 158127, RESELLER, 5d62403b186f2ace +sharethrough.com, 62beb9db, DIRECT, d53b998a7bd4ecd2 +spotxchange.com, 212457, RESELLER, 7842df1d2fe2db34 +spotx.tv, 212457, RESELLER, 7842df1d2fe2db34 +pubmatic.com, 156557, RESELLER, 5d62403b186f2ace +rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 +openx.com, 540274407, RESELLER, 6a698e2ec38604c6 +indexexchange.com, 186046, RESELLER, 50b1c356f2c5c8fc +conversantmedia.com, 42037, DIRECT, 03113cd04947736d +appnexus.com, 4052, RESELLER, f5ab79cb980f11d1 +contextweb.com, 561998, RESELLER, 89ff185a4c4e857c +pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 +aps.amazon.com, 76101559-a029-4be1-a789-2346123df063, DIRECT +pubmatic.com, 157150, RESELLER, 5d62403b186f2ace +openx.com, 540191398, RESELLER, 6a698e2ec38604c6 +rubiconproject.com, 18020, RESELLER, 0bfd66d529a55807 +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 +adtech.com, 12068, RESELLER, e1a5b5b6e3255540 +districtm.io, 100962, RESELLER, 3fd707be9c4527c3 +rhythmone.com, 1654642120, RESELLER, a670c89d4a324e47 +mgid.com, 130961, DIRECT, d4c29acad76ce94f +synacor.com, 82188, DIRECT, e108f11b2cdf7d5b +33across.com, 0014000001aXjnGAAS, RESELLER, bbea06d9c4d2853c +gumgum.com, 13318, RESELLER, ffdef49475d318a9 +appnexus.com, 9316, RESELLER, f5ab79cb980f11d1 +districtm.io, 101769, RESELLER, 3fd707be9c4527c3 +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 +pubmatic.com, 156344, RESELLER, 5d62403b186f2ace +aralego.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER +ucfunnel.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER +sonobi.com, 0b24fdfc82, DIRECT, d1a215d9eb5aee9e +rhythmone.com, 1059622079, RESELLER, a670c89d4a324e47 +contextweb.com, 560606, RESELLER, 89ff185a4c4e857c +my6sense.com, 10379, DIRECT +districtm.io, 101966, DIRECT, 3fd707be9c4527c3 +rhythmone.com, 2298741357, DIRECT, a670c89d4a324e47 +adtelligent.com, 500592, DIRECT +appnexus.com, 3153, RESELLER, f5ab79cb980f11d1 +onetag.com, 59a18369e249bfb, DIRECT +adtech.com, 12069, RESELLER +33across.com, 0010b00002VYZoUAAX, DIRECT, bbea06d9c4d2853c +rubiconproject.com, 21642, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 21434, RESELLER, 0bfd66d529a55807 +pubmatic.com, 158569, RESELLER, 5d62403b186f2ace +sonobi.com, a416546bb7, RESELLER, d1a215d9eb5aee9e +indexexchange.com, 190966, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 191625, DIRECT, 50b1c356f2c5c8fc +contextweb.com, 560288, RESELLER, 89ff185a4c4e857c +pubmatic.com, 156439, RESELLER, 5d62403b186f2ace +pubmatic.com, 154037, RESELLER, 5d62403b186f2ace +rubiconproject.com, 16114, RESELLER, 0bfd66d529a55807 +openx.com, 537149888, RESELLER, 6a698e2ec38604c6 +appnexus.com, 3703, RESELLER, f5ab79cb980f11d1 +districtm.io, 101760, RESELLER, 3fd707be9c4527c3 +loopme.com, s-2411, RESELLER, 6c8d5f95897a5a3b +loopme.com, 5679, RESELLER, 6c8d5f95897a5a3b +xad.com, 958, RESELLER, 81cbf0a75a5e0e9a +rhythmone.com, 2564526802, RESELLER, a670c89d4a324e47 +smaato.com, 1100044045, RESELLER, 07bcf65f187117b4 +pubnative.net, 1006576, RESELLER, d641df8625486a7b +adyoulike.com, b4bf4fdd9b0b915f746f6747ff432bde, RESELLER, 4ad745ead2958bf7 +telaria.com, 0t5pq-x619c, DIRECT, 1a4e959a1b50034a +tremorhub.com, 0t5pq-x619c, DIRECT, 1a4e959a1b50034a +synacor.com, 82378, DIRECT, e108f11b2cdf7d5b +yahoo.com, 57758, RESELLER, e1a5b5b6e3255540 +smartadserver.com, 3663, DIRECT +google.com, pub-4377140038207096, DIRECT, f08c47fec0942fa0 +yahoo.com, 57289, RESELLER, e1a5b5b6e3255540 +indexexchange.com, 191973, RESELLER, 50b1c356f2c5c8fc +advertising.com, 19623, RESELLER +conversantmedia.com, 20923, RESELLER +engagebdr.com, 10417, RESELLER +google.com, pub-9242135695870166, RESELLER, f08c47fec0942fa0 +indexexchange.com, 191740, RESELLER, 50b1c356f2c5c8fc +themediagrid.com, P5JONV, RESELLER, 35d5010d7789b49d +onetag.com, 572a470226457b8, RESELLER +openx.com, 540401713, RESELLER, 6a698e2ec38604c6 +contextweb.com, 562270, RESELLER, 89ff185a4c4e857c +advertising.com, 28605, RESELLER +appnexus.com, 6849, RESELLER, f5ab79cb980f11d1 +indexexchange.com, 182257, RESELLER, 50b1c356f2c5c8fc +pubmatic.com, 159277, RESELLER, 5d62403b186f2ace +rhythmone.com, 905992537, RESELLER, a670c89d4a324e47 +rubiconproject.com, 15268, RESELLER, 0bfd66d529a55807 +spotx.tv, 285547, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 285547, RESELLER, 7842df1d2fe2db34 +video.unrulymedia.com, 905992537, RESELLER, a670c89d4a324e47 +spotx.tv, 94794, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 94794, RESELLER, 7842df1d2fe2db34 +advertising.com, 26282, RESELLER +beachfront.com, 4969, RESELLER, e2541279e8e2ca4d +mobileadtrading.com, baf4006e2cf0c06478aa5d2e2097d109, RESELLER +pubmatic.com, 157310, RESELLER, 5d62403b186f2ace +somoaudience.com, baf4006e2cf0c06478aa5d2e2097d109, RESELLER +springserve.com, 278, RESELLER, a24eb641fc82e93d +yahoo.com, 55317, RESELLER, e1a5b5b6e3255540 +sovrn.com, 331050, DIRECT, fafdf38b16bf6b2b +lijit.com, 331050, DIRECT, fafdf38b16bf6b2b +lijit.com, 331050-eb, DIRECT, fafdf38b16bf6b2b +appnexus.com, 1360, RESELLER, f5ab79cb980f11d1 +gumgum.com, 11645, RESELLER, ffdef49475d318a9 +openx.com, 538959099, RESELLER, 6a698e2ec38604c6 +pubmatic.com, 137711, RESELLER, 5d62403b186f2ace +pubmatic.com, 156212, RESELLER, 5d62403b186f2ace +rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 +emxdgt.com, 1323, DIRECT, 1e1d41537f7cad7f +appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 +appnexus.com, 11664, RESELLER, f5ab79cb980f11d1 +emxdgt.com, 273, RESELLER, 1e1d41537f7cad7f +indexexchange.com, 183875, RESELLER, 50b1c356f2c5c8fc +contextweb.com, 562258, RESELLER, 89ff185a4c4e857c +rubiconproject.com, 17250, RESELLER, 0bfd66d529a55807 +triplelift.com, 2792, RESELLER, 6c33edb13117fd86 +rhythmone.com, 3403014119, DIRECT, a670c89d4a324e47 +video.unrulymedia.com, 3403014119, DIRECT +rubiconproject.com, 23564, DIRECT, 0bfd66d529a55807 +rubiconproject.com, 23566, RESELLER, 0bfd66d529a55807 +#pixfuture END updated Aug-3-2021 diff --git a/res/template/advertisements.html b/res/template/advertisements.html index b1c4b80..20087bb 100644 --- a/res/template/advertisements.html +++ b/res/template/advertisements.html @@ -87,9 +87,34 @@ {{ else if eq .Other.AdBannerType 12 }} +
+ {{ else if eq .Other.AdBannerType 14 }} + + + + + + +
+ +
+ {{ else if eq .Other.AdBannerType 15 }} + +
+ + {{ end }} {{ end }} @@ -102,14 +127,7 @@ {{ else if eq .Other.AdFloaterType 1 }} - {{ end }} diff --git a/webcontroller/file_preview.go b/webcontroller/file_preview.go index b2f6081..888f863 100644 --- a/webcontroller/file_preview.go +++ b/webcontroller/file_preview.go @@ -15,7 +15,7 @@ import ( // ServeFilePreview controller for GET /u/:id/preview func (wc *WebController) serveFilePreview(w http.ResponseWriter, r *http.Request, p httprouter.Params) { - if p.ByName("id") == "demo" { + if p.ByName("id") == "demo" || p.ByName("id") == "adsplus" || p.ByName("id") == "pixfuture" { serveFilePreviewDemo(w) // Required for a-ads.com quality check return } diff --git a/webcontroller/file_viewer.go b/webcontroller/file_viewer.go index 093362a..2881c0e 100644 --- a/webcontroller/file_viewer.go +++ b/webcontroller/file_viewer.go @@ -64,6 +64,8 @@ func (vd *viewerData) adType(files []pixelapi.ListFile) { pdpro4 = 11 clickAduBanner = 12 amarulaElectronics = 13 + adsPlus = 14 + pixFuture = 15 // Floaters propellerFloat = 1 @@ -78,17 +80,21 @@ func (vd *viewerData) adType(files []pixelapi.ListFile) { // Intn returns a number up to n, but never n itself. So to 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 - switch i := rand.Intn(5); i { - case 0: // 20% + switch i := rand.Intn(8); i { + case 0: vd.AdBannerType = brave - case 1, 2, 3, 4: // 80% + case 1: vd.AdBannerType = aAds + case 2, 3, 4: + vd.AdBannerType = adsPlus + case 5, 6, 7: + vd.AdBannerType = pixFuture default: panic(fmt.Errorf("random number generator returned unrecognised number: %d", i)) } - // If the file is larger than 5 MB we enable floating popups - if avgSize > 5e6 { + // If the file is larger than 10 MB we enable floating popups + if avgSize > 10e6 { vd.AdFloaterType = propellerFloat } } @@ -97,7 +103,13 @@ func (vd *viewerData) adType(files []pixelapi.ListFile) { func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request, p httprouter.Params) { var err error if p.ByName("id") == "demo" { - wc.serveFileViewerDemo(w, r) // Required for a-ads.com quality check + wc.serveFileViewerDemo(w, r, 1) // Required for a-ads.com quality check + return + } else if p.ByName("id") == "adsplus" { + wc.serveFileViewerDemo(w, r, 14) + return + } else if p.ByName("id") == "pixfuture" { + wc.serveFileViewerDemo(w, r, 15) return } @@ -183,12 +195,12 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request, // ServeFileViewerDemo is a dummy API response that responds with info about a // non-existent demo file. This is required by the a-ads ad network to allow for // automatic checking of the presence of the ad unit on this page. -func (wc *WebController) serveFileViewerDemo(w http.ResponseWriter, r *http.Request) { +func (wc *WebController) serveFileViewerDemo(w http.ResponseWriter, r *http.Request, banner int) { templateData := wc.newTemplateData(w, r) templateData.Other = viewerData{ Type: "file", CaptchaKey: wc.captchaSiteKey, - AdBannerType: 1, // Always show a-ads on the demo page + AdBannerType: banner, // Always show a-ads on the demo page FileAdsEnabled: true, UserAdsEnabled: true, APIResponse: map[string]interface{}{