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/toshinie/facebook-marketing-api-golang-sdk
Forked from justwatchcom/facebook-marketing-api-golang-sdk
The SDK supports crud operations for the following entities:
We assume you already have a Facebook Developer account and configured an accessToken
and appSecret
. If not, checkout Facebooks Get Started
import(
"github.com/toshiNie/facebook-marketing-api-golang-sdk/marketing/v14"
)
func main(){
fbService, _ := v14.New(fb.NewClient(_accessToken, _clientSecret))
// [Code snippets from other example below go here]
}
c := v14.Campaign{
// Populate struct values
}
id, _ := fbService.Campaigns.Create(ctx, c)
accountID := "[account id]"
imagePath := "[path to image]"
imageName := "[image name]"
file, _ := os.Open(imagePath)
im, _ := fbService.Images.Upload(context.Background(), accountID,imageName, file)
// You now can access the ID of the uploaded image via im.ID
fmt.Println("Uploaded image has id: ", im.ID)
accountID := "[account id]"
videoPath := "[path to video]"
videoName := "[video name]"
file, _ := os.Open(videoPath)
vid, _ := fbService.Videos.Upload(context.Background(), accountID, videoName, file)
// You now can access the ID of the uploaded video via vid.ID
fmt.Println("Uploaded video has id: ", vid.ID)
id := "[account_id]"
campaigns, _ := p.fbService.Campaigns.List(id).Do(ctx)
// put the columns you need for the report
columns := []string {}
//account id you want the report from
id := "[account_id]"
// Create new report
report := fbService.Insights.NewReport(id)
// Configure report
report.Level("adset").
DailyTimeIncrement(true). // get day by day reporting
Fields(columns...). // the fields you want your report to have
DatePreset("lifetime") // the time period for the report
// pass a channel which gets populated with results
ch := make(chan v14.Insight)
nRecords,_ := report.GenerateReport(ctx,ch)
//range over the channel to get Insight objects
for insight := range ch {
fmt.Println("New report result: ", insight)
}
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.