twitter

package
v0.0.0-...-9ccfb5e Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTwitterStream

func NewTwitterStream(baseUrl string) (stream *Stream, err error)

NewTwitterStream create a new GOTOJS stream implementation that is bound to the twitter API stream using the default "twitter_account.json" configuration file.

Types

type Tweet

type Tweet struct {
	Long        float64  `json:"long"`
	Lat         float64  `json:"lat"`
	Text        string   `json:"text"`
	Sender      string   `json:"sender"`
	Retweet     bool     `json:"retweet"`
	Images      []string `json:"images"`
	Thumbnail   string   `json:"thumbnail"`
	IsNude      bool     `json:"isnude"`
	IsSensitive bool     `json:"issensitive"`
}

type TwitterSource

type TwitterSource struct {
	// contains filtered or unexported fields
}

func NewTwitterSource

func NewTwitterSource(account, stream, baseUrl string) (ret *TwitterSource, err error)

NewTwitterSource creates a new stream source based on the given configuration file.

func (*TwitterSource) Close

func (s *TwitterSource) Close()

Close interruptes the source stream. The connection to the twitter API is closed.

func (*TwitterSource) Next

func (s *TwitterSource) Next() (mes Message, err error)

Next fetches the next message from the source stream.

func (*TwitterSource) Start

func (s *TwitterSource) Start() (err error)

Start starts the source stream. A connection to the twitter API is established.

type TwitterStreamConfig

type TwitterStreamConfig struct {
	ThumbnailMethod  string `json:"ThumbnailMethod"` // [api,url,dataurl]
	ThumbnailSize    int    `json:"ThumbnailSize"`
	ThumbnailAPICall string `json:"ThumbnailAPICall"` // "Image/Thumbnail?p=%s&p=%s&p=%s"
	NudeFilter       bool   `json:"NudeFilter"`
	TranscodeWorker  int    `json:"TranscodeWorker"`
	TranscodeBuffer  int    `json:"TranscodeBuffer"`
	BaseUrl          string `json:"BaseUrl"` // "http://localhost:8080/gotojs/"
}

func (*TwitterStreamConfig) APIUrl

func (s *TwitterStreamConfig) APIUrl(u string) string

func (*TwitterStreamConfig) JSON

func (s *TwitterStreamConfig) JSON() string

Jump to

Keyboard shortcuts

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