/go-facebook

A Facebook API library for Go

Primary LanguageGoMIT LicenseMIT

go-facebook

A basic Facebook SDK for Go.

travis-ci status for jimmysawczuk/go-facebook GoDoc Go Report Card

Installation

Install this package by typing go get github.com/jimmysawczuk/go-facebook in your terminal. You can then use it in your import statement like so:

import (
	"github.com/jimmysawczuk/go-facebook"
)

Example

package main

import (
    "github.com/jimmysawczuk/go-facebook"
    "github.com/jimmysawczuk/go-facebook/types"
    "fmt"
)

func main() {
    fb := facebook.New("<app id>", "<secret>")
    fb.SetAccessToken("<token>")

    user, err := fb.GetUser("me")
    fmt.Println(user, err)

    resp := types.Page{}
    err = fb.Get("/starbucks", nil).Exec(&resp)
    fmt.Println(resp, err)
}

Documentation

You can find the latest godoc output for this repository at GoDoc.org.

License

go-facebook is released under the MIT license.