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/azoff/facebook
This is a Go library fully supports Facebook Graph API with file upload, batch request and FQL. It's simple but powerful.
Here is a sample to read my Facebook username by uid.
package main
import (
"fmt"
fb "github.com/huandu/facebook"
)
func main() {
res, _ := fb.Get("/538744468", fb.Params{
"fields": "username",
})
fmt.Println("here is my facebook username:", res["username"])
}
Type of res["username"]
is interface{}
. This library provides several helpful methods to decode fields to any Go type or even a custom Go struct.
// Decode "username" to a go string.
var username string
res.DecodeField("username", &username)
fmt.Println("alternative way to get username:", username)
// It's also possible to decode the whole result into a predefined struct.
type User struct {
Username string
}
var user User
res.Decode(&user)
fmt.Println("print username in struct:", user.Username)
Read http://godoc.org/github.com/huandu/facebook or use go doc
.
Use go get github.com/huandu/facebook
to get and install it.
This library is licensed under MIT license. See LICENSE for details.
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.