goFbAlbum

package module
v0.0.0-...-225744a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 5 Imported by: 1

README

goFbAlbum

GitHub license GoDoc Build Status

A facebook photo album tool.

Contribute

Please open up an issue on GitHub before you put a lot efforts on pull request. The code submitting to PR must be filtered with gofmt

Advertising

If you want to browse facebook page on your iPhone, why not check my App here :p 粉絲相簿

Project52

It is one of my project 52.

License

This package is licensed under MIT license. See LICENSE for details.

Bitdeli Badge

Documentation

Overview

Package goFbAlbum is a tools to Facebook albums and photos.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMapToStruct

func ParseMapToStruct(inData interface{}, decodeStruct interface{})

Parse Graph API result and convert to specific interface.

Types

type FBAlbums

type FBAlbums struct {
	Data []struct {
		CanUpload bool `json:"can_upload"`
		Comments  struct {
			Data []struct {
				CanRemove   bool   `json:"can_remove"`
				CreatedTime string `json:"created_time"`
				From        struct {
					ID   string `json:"id"`
					Name string `json:"name"`
				} `json:"from"`
				ID        string `json:"id"`
				LikeCount int    `json:"like_count"`
				Message   string `json:"message"`
				UserLikes bool   `json:"user_likes"`
			} `json:"data"`
			Paging struct {
				Cursors struct {
					After  string `json:"after"`
					Before string `json:"before"`
				} `json:"cursors"`
			} `json:"paging"`
		} `json:"comments"`
		Count       int    `json:"count"`
		CoverPhoto  string `json:"cover_photo"`
		CreatedTime string `json:"created_time"`
		From        struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"from"`
		ID          string `json:"id"`
		Link        string `json:"link"`
		Name        string `json:"name"`
		Privacy     string `json:"privacy"`
		Type        string `json:"type"`
		UpdatedTime string `json:"updated_time"`
	} `json:"data"`
	Paging struct {
		Cursors struct {
			After  string `json:"after"`
			Before string `json:"before"`
		} `json:"cursors"`
		Next string `json:"next"`
	} `json:"paging"`
}

type FBPhotos

type FBPhotos struct {
	Data []struct {
		ID          string `json:"id"`
		CreatedTime string `json:"created_time"`
		From        struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"from"`
		Height int    `json:"height"`
		Icon   string `json:"icon"`
		Images []struct {
			Height int    `json:"height"`
			Source string `json:"source"`
			Width  int    `json:"width"`
		} `json:"images"`
		Link    string `json:"link"`
		Name    string `json:"name"`
		Picture string `json:"picture"`
		Place   struct {
			Name     string `json:"name"`
			Location struct {
				City      string  `json:"city"`
				Country   string  `json:"country"`
				Latitude  float64 `json:"latitude"`
				Longitude float64 `json:"longitude"`
				Street    string  `json:"street"`
				Zip       string  `json:"zip"`
			} `json:"location"`
			ID string `json:"id"`
		} `json:"place"`
		Source      string `json:"source"`
		UpdatedTime string `json:"updated_time"`
		Width       int    `json:"width"`
		Tags        struct {
			Data []struct {
				ID          string  `json:"id"`
				Name        string  `json:"name"`
				CreatedTime string  `json:"created_time"`
				X           float64 `json:"x"`
				Y           float64 `json:"y"`
			} `json:"data"`
			Paging struct {
				Cursors struct {
					Before string `json:"before"`
					After  string `json:"after"`
				} `json:"cursors"`
			} `json:"paging"`
		} `json:"tags"`
		Likes struct {
			Data []struct {
				ID   string `json:"id"`
				Name string `json:"name"`
			} `json:"data"`
			Paging struct {
				Cursors struct {
					Before string `json:"before"`
					After  string `json:"after"`
				} `json:"cursors"`
				Next string `json:"next"`
			} `json:"paging"`
		} `json:"likes"`
	} `json:"data"`
	Paging struct {
		Cursors struct {
			Before string `json:"before"`
			After  string `json:"after"`
		} `json:"cursors"`
		Next string `json:"next"`
	} `json:"paging"`
}

type FBUser

type FBUser struct {
	ID       string `json:"id"`
	About    string `json:"about"`
	Awards   string `json:"awards"`
	CanPost  bool   `json:"can_post"`
	Category string `json:"category"`
	Checkins int    `json:"checkins"`
	Cover    struct {
		CoverID string `json:"cover_id"`
		OffsetX int    `json:"offset_x"`
		OffsetY int    `json:"offset_y"`
		Source  string `json:"source"`
		ID      string `json:"id"`
	} `json:"cover"`
	HasAddedApp     bool   `json:"has_added_app"`
	IsCommunityPage bool   `json:"is_community_page"`
	IsPublished     bool   `json:"is_published"`
	Likes           int    `json:"likes"`
	Link            string `json:"link"`
	Location        struct {
		Zip string `json:"zip"`
	} `json:"location"`
	Name    string `json:"name"`
	Parking struct {
		Lot    int `json:"lot"`
		Street int `json:"street"`
		Valet  int `json:"valet"`
	} `json:"parking"`
	PersonalInfo      string `json:"personal_info"`
	PersonalInterests string `json:"personal_interests"`
	TalkingAboutCount int    `json:"talking_about_count"`
	Username          string `json:"username"`
	WereHereCount     int    `json:"were_here_count"`
}

type FbAlbum

type FbAlbum struct {
	Token string
}

func NewFbAlbum

func NewFbAlbum(token string) *FbAlbum

Constructor

func (*FbAlbum) GetAlbumsByUserId

func (self *FbAlbum) GetAlbumsByUserId(uid string) (*FBAlbums, error)

Get all album using user id. note: this function only work if you provide a page id or page name. such as scottiepippen or 112743018776863.

func (*FbAlbum) GetMyAlbums

func (self *FbAlbum) GetMyAlbums() (*FBAlbums, error)

Get my all albums

func (*FbAlbum) GetPhotoByAlbum

func (self *FbAlbum) GetPhotoByAlbum(albumId string, count int) (*FBPhotos, error)

Get all photo from a album id, you can get album id from FBAlbums{} struct.

func (*FbAlbum) RunFBGraphAPI

func (self *FbAlbum) RunFBGraphAPI(query string) (queryResult interface{})

FaceBook Graph Query API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL