Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kutabe/vk
API wrapper for VK (vk.com) written in go (golang)
https://github.com/kutabe/vk
api golang vk vk-api vkontakte vkontakte-api wrapper
Last synced: 3 months ago
JSON representation
API wrapper for VK (vk.com) written in go (golang)
- Host: GitHub
- URL: https://github.com/kutabe/vk
- Owner: Kutabe
- Created: 2015-12-06T01:56:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-05T18:28:07.000Z (almost 8 years ago)
- Last Synced: 2024-11-06T14:01:36.043Z (3 months ago)
- Topics: api, golang, vk, vk-api, vkontakte, vkontakte-api, wrapper
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 29
- Watchers: 5
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vk
vk is a golang package that provides tools to interact with the API of the social network [VK](http://vk.com)
## Install
```
go get github.com/Kutabe/vk
```
## Usage example
```go
package main
import (
"fmt"
"github.com/Kutabe/vk"
)
func main() {
login := "[email protected]" //your VK login
password := "mypassword" // your VK password
user, err := vk.Auth(login, password)
if err != nil {
panic(err)
}
if user.Error != "" {
fmt.Println(user.ErrorDescription)
} else {
parameters := make(map[string]string)
parameters["user_id"] = "123456789" // receiver's user ID
parameters["message"] = "Greetings from Golang!" // message
parameters["version"] = "5.59" // VK API version
resp, err := vk.Request("messages.send", parameters, user)
if err != nil {
panic(err)
}
fmt.Printf("%s", resp) //This should be your message id
}
}
```## Used in
- [vkgetmusic](https://github.com/wingrime/vkgetmusic)