add banner ad view counting

This commit is contained in:
Wim Brand
2020-02-21 13:14:21 +01:00
parent f17e58df29
commit e4eb24d8d1
6 changed files with 56 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package pixelapi
import (
"io"
"net/url"
"time"
)
@@ -36,3 +37,9 @@ type FileInfo struct {
func (p *PixelAPI) GetFileInfo(id string) (resp FileInfo, err error) {
return resp, p.jsonRequest("GET", p.apiEndpoint+"/file/"+id+"/info", &resp)
}
func (p *PixelAPI) PostFileView(id, viewtoken string) (err error) {
vals := url.Values{}
vals.Set("token", viewtoken)
return p.form("POST", p.apiEndpoint+"/file/"+id+"/view", vals, nil, true)
}