Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/nikon72ru/yandex-audience-api
Entity | Method | Support |
---|---|---|
Pixels | List of pixels | :heavy_check_mark: |
Pixels | Create pixel | :heavy_check_mark: |
Pixels | Update pixel | :heavy_check_mark: |
Pixels | Remove pixel | :heavy_check_mark: |
Pixels | Restore pixel | :heavy_check_mark: |
Delegates | List of delegates | :heavy_check_mark: |
Delegates | Create delegate | :heavy_check_mark: |
Delegates | Remove delegate | :heavy_check_mark: |
Accounts | List of accounts | :heavy_check_mark: |
Grants | List of grants | :heavy_check_mark: |
Grants | Create grant | :heavy_check_mark: |
Grants | Remove grant | :heavy_check_mark: |
Segments | Segments list | :heavy_check_mark: |
Segments | Create "pixel" segment | :heavy_check_mark: |
Segments | Create "lookalike" segment | :heavy_check_mark: |
Segments | Create segment from metrika | :heavy_check_mark: |
Segments | Create segment from app metrika | :heavy_check_mark: |
Segments | Create geo-circle segment | :heavy_check_mark: |
Segments | Create geo-polygons segment | :heavy_check_mark: |
Segments | Create segment from file | :heavy_check_mark: |
Segments | Create segment from csv | :heavy_check_mark: |
Segments | Save uploaded segment | :heavy_check_mark: |
Segments | Update segment | :heavy_check_mark: |
Segments | Remove segment | :heavy_check_mark: |
Segments | Reprocess segment | :heavy_check_mark: |
Segments | Update coords in geo-circle segment | :x: |
Segments | Save uploaded ClientID segment | :x: |
Segments | Update uploaded segment | :x: |
package main
import (
"context"
"fmt"
"github.com/nikon72ru/yandex-audience-api/audience"
"log"
)
func main() {
//Creating audience client
client, _ := audience.NewClient(context.Background())
//Get all my segments
allMySegments, _ := client.SegmentsList()
_ = allMySegments
//Create segment
var segment = audience.CircleGeoSegment{
BaseSegment: audience.BaseSegment{
Name: "My new segment",
},
GeoSegmentType: "work",
TimesQuantity: 20,
PeriodLength: 30,
Radius: 500,
Points: []audience.Point{{
Latitude: 65.534102,
Longitude: 57.157753,
Description: "random point",
}}}
if err := client.CreateCircleGeoSegment(&segment); err != nil {
log.Fatal(err)
}
//Check ID of created segment
fmt.Println(segment.ID)
//Updating created segment
segment.Name = "My updated segment"
if err := client.UpdateSegment(segment.ID, &segment); err != nil {
log.Fatal(err)
}
//Remove segment
if err := client.RemoveSegment(segment.ID); err != nil {
log.Fatal(err)
}
}
export YANDEX_AUDIENCE_TOKEN=[YOUR TOKEN]
func main() {
//Creating audience client
client, _ := audience.NewClient(context.WithValue(context.Background(), "YANDEX_AUDIENCE_TOKEN", "[YOUR TOKEN]"))
//Your another cool code
}
- Notice! You need to save segment after uploading
func main() {
//Creating audience client
client, _ := audience.NewClient(context.Background())
var segment = audience.UploadingSegment{
BaseSegment: audience.BaseSegment{
Name: "segment from file",
},
Hashed: false,
ContentType: audience.Mac,
}
//upload file
if err := client.CreateFileSegment(&segment, "./test-files/macs_for_uploads.csv"); err != nil {
log.Fatal(err)
}
//Save uploaded segment
if err := client.SaveUploadedSegment(&segment); err != nil {
log.Fatal(err)
}
}
Welcome to create issue!
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.