gfxBot

package
v0.0.0-...-31a6de3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2015 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaxCaption define the maximum size of image captions (It seems telegram
	// image captions have a size limit).
	MaxCaption = 200
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string, config interface{}) (err error)

Types

type Duck

type Duck struct {
	Service string
}

func NewDuck

func NewDuck() *Duck

func (*Duck) Search

func (d *Duck) Search(q string) (*Image, error)

type Flickr

type Flickr struct {
	ApiKey    string
	ApiSecret string
	Client    *flickr.FlickrClient
}

func NewFlickr

func NewFlickr(apiKey string, apiSecret string) *Flickr

func (*Flickr) Search

func (f *Flickr) Search(q string) (*Image, error)

type GlobalConfig

type GlobalConfig struct {
	Token              string
	FlickrAPIKey       string
	FlickrAPISecret    string
	InstagramAPIKey    string
	InstagramAPISecret string
	InstagramAPIToken  string
}

type Image

type Image struct {
	Data     []byte
	URL      string
	Width    int
	Height   int
	Caption  string
	Ext      string
	Filename string
}

func NewImage

func NewImage(url string, caption string) (*Image, error)

func (*Image) Close

func (img *Image) Close() (err error)

func (*Image) Download

func (img *Image) Download() error

func (*Image) Save

func (img *Image) Save(path string) error

func (*Image) Send

func (img *Image) Send(bot *telebot.Bot, msg telebot.Message) (err error)

func (*Image) Write

func (img *Image) Write(p []byte) (n int, err error)

type Instagram

type Instagram struct {
	APIKey    string
	APISecret string
	APIToken  string
	Client    *instagram.Client
	Service   string
}

Instagram implements the gfxbot instagram service.

func NewInstagram

func NewInstagram(apiKey string, apiSecret string, apiToken string) *Instagram

NewInstagram returns an initialized Instagram service.

func (*Instagram) Search

func (i *Instagram) Search(q string) (*Image, error)

Search into Instagram service for a given string.

type Photo

type Photo struct {
	Name     string `xml:",chardata"`
	Id       int    `xml:"id,attr"`
	Owner    string `xml:"owner,attr"`
	Secret   string `xml:"secret,attr"`
	Server   int    `xml:"server,attr"`
	Farm     int    `xml:"farm,attr"`
	Title    string `xml:"title,attr"`
	IsPublic bool   `xml:"ispublic,attr"`
	IsFriend bool   `xml:"isfriend,attr"`
	IsFamily bool   `xml:"isfamily,attr"`
}

type Photos

type Photos struct {
	XMLName xml.Name `xml:"photos"`
	Photos  []Photo  `xml:"photo"`
}

type ProxyConfig

type ProxyConfig struct {
	Host     string
	Port     int
	Password string
	Nick     string
	RealName string
}

Jump to

Keyboard shortcuts

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