A minimalistic Flickr API client for Go
$ go get github.com/azer/go-flickr
import (
"github.com/azer/go-flickr"
)
client := &flickr.Client{
Key: "key",
Token: "token", // optional
Sig: "sig", // optional
}
response, err := client.Get("people.findByUsername", &flickr.Params{ "username": "azer" })
// => {"user":{"id":"98269877@N00", "nsid":"98269877@N00", "username":{"_content":"azerbike"}}, "stat":"ok"}
Find user by name.
user, err := client.FindUser("azer")
user.Id
// => "123124324"
user.Name
// => azer
List the people given user follows on Flickr
userId := "123123123"
following, err := client.Following(userId)
List photos in the album with given ID
photos, err := client.Album("72157662053417706")
List photos that have been favorited by the given user ID. Note the Flickr API returns the list as paginated results.
client, err := flickr.NewPhotosClient()
favs, err := client.Favs("98269877@N00")
if favs.Pages > 1 {
favs, err = client.NextPage()
}