mentionbot

package module
v0.0.0-...-47ac2c1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2015 License: MIT Imports: 12 Imported by: 1

README

Build Status

mentionbot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot type

func NewBot

func NewBot(config *Config) *Bot

NewBot returns new bot

func (*Bot) Debug

func (bot *Bot) Debug(enabled bool)

Debug sets debug flag

func (*Bot) Run

func (bot *Bot) Run() (err error)

Run bot

func (*Bot) SetMentioner

func (bot *Bot) SetMentioner(m Mentioner)

SetMentioner sets mentioner instance

type Config

type Config struct {
	UserID            string
	ConsumerKey       string
	ConsumerSecret    string
	AccessToken       string
	AccessTokenSecret string
}

Config type

type Entities

type Entities struct {
	Media            []interface{} `json:"media"`
	Urls             []interface{} `json:"urls"`
	UserMentions     []interface{} `json:"user_mentions"`
	Hashtags         []interface{} `json:"hashtags"`
	Symbols          []interface{} `json:"symbols"`
	ExtendedEntities []interface{} `json:"extended_entities"`
}

Entities type

type Mentioner

type Mentioner interface {
	Mention(*Tweet) *string
}

Mentioner interface

type Tweet

type Tweet struct {
	CreatedAt            string   `json:"created_at"`
	FavoriteCount        int      `json:"favorite_count"`
	Favorited            bool     `json:"favorited"`
	ID                   int64    `json:"id"`
	IDStr                string   `json:"id_str"`
	InReplyToScreenName  string   `json:"in_reply_to_screen_name"`
	InReplyToStatusID    int64    `json:"in_reply_to_status_id"`
	InReplyToStatusIDStr string   `json:"in_reply_to_status_id_str"`
	InReplyToUserID      int64    `json:"in_reply_to_user_id"`
	InReplyToUserIDStr   string   `json:"in_reply_to_user_id_str"`
	Lang                 string   `json:"lang"`
	RetweetCount         int      `json:"retweet_count"`
	Retweeted            bool     `json:"retweeted"`
	RetweetedStatus      *Tweet   `json:"retweeted_status"`
	Source               string   `json:"source"`
	Text                 string   `json:"text"`
	User                 User     `json:"user"`
	Entities             Entities `json:"entities"`
}

Tweet type

func (Tweet) CreatedAtTime

func (t Tweet) CreatedAtTime() (time.Time, error)

CreatedAtTime returns the created_at time, parsed as a time.Time struct

type User

type User struct {
	CreatedAt         string `json:"created_at"`
	Description       string `json:"description"`
	FavouritesCount   int    `json:"favourites_count"`
	FollowRequestSent bool   `json:"follow_request_sent"`
	FollowersCount    int    `json:"followers_count"`
	Following         bool   `json:"following"`
	FriendsCount      int    `json:"friends_count"`
	ID                int64  `json:"id"`
	IDStr             string `json:"id_str"`
	ListedCount       int64  `json:"listed_count"`
	Location          string `json:"location"`
	Name              string `json:"name"`
	ProfileBannerURL  string `json:"profile_banner_url"`
	ProfileImageURL   string `json:"profile_image_url"`
	Protected         bool   `json:"protected"`
	ScreenName        string `json:"screen_name"`
	Status            *Tweet `json:"status"`
	StatusesCount     int64  `json:"statuses_count"`
	URL               string `json:"url"`
	Verified          bool   `json:"verified"`
}

User type

Jump to

Keyboard shortcuts

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