Socket
Socket
Sign inDemoInstall

github.com/SergeyParamoshkin/golang-vk-api

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/SergeyParamoshkin/golang-vk-api


Version published

Readme

Source

VK API wrapper in golang

Installing

go get github.com/himidori/golang-vk-api

Authorizing using username and password

client, err := vkapi.NewVKClient(vkapi.DeviceIPhone, "username", "password")

Authorizing using access token

client, err := vkapi.NewVKClientWithToken("token", nil)

Listening longpoll events

// listening received messages
client.AddLongpollCallback("msgin", func(m *vkapi.LongPollMessage) {
	fmt.Printf("new message received from uid %d\n", m.UserID)
})

// listening deleted messages
client.AddLongpollCallback("msgdel", func(m *vkapi.LongPollMessage) {
	fmt.Printf("message %d was deleted\n", m.MessageID)
})

// listening sent messages
client.AddLongpollCallback("msgout", func(m *vkapi.LongPollMessage) {
	fmt.Printf("sent message to uid %d\n", m.UserID)
})

// listening read messages
client.AddLongpollCallback("msgread", func(m *vkapi.LongPollMessage) {
	fmt.Printf("message %d was read\n", m.MessageID)
})

// listening users online
client.AddLongpollCallback("msgonline", func(m *vkapi.LongPollMessage) {
	fmt.Printf("user %d is now online\n", m.UserID)

// starting 
client.ListenLongPollServer()

ads sponsored by elenoise.ru

  • addOfficeUsers
  • checkLink
  • createAds
  • createCampaigns
  • createClients
  • createLookalikeRequest
  • createTargetGroup
  • createTargetPixel
  • deleteAds
  • deleteCampaigns
  • deleteClients
  • deleteTargetGroup
  • deleteTargetPixel
  • getAccounts
  • getAds
  • getAdsLayout
  • getAdsTargeting
  • getBudget
  • getCampaigns
  • getCategories
  • getClients
  • getDemographics
  • getFloodStats
  • getLookalikeRequests
  • getOfficeUsers
  • getPostsReach
  • getRejectionReason
  • getStatistics
  • getSuggestions
  • getTargetGroups
  • getTargetPixels
  • getTargetingStats
  • getUploadURL
  • getVideoUploadURL
  • importTargetContacts
  • removeOfficeUsers
  • removeTargetContacts
  • saveLookalikeRequestResult
  • shareTargetGroup
  • updateAds
  • updateCampaigns
  • updateClients
  • updateTargetGroup
  • updateTargetPixel

FAQs

Last updated on 22 Mar 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc