twitter

package
v0.0.0-...-94dab28 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderID = `twitter`
	TimeLayout = `Mon Jan 02 15:04:05 -0700 2006`
)

Variables

View Source
var (
	AppID         string
	AppSecret     string
	OAuthCallback string
)

Functions

func Configure

func Configure(appID string, appSecret string, oauthCallback string)

func NewOAuth

func NewOAuth() social.OAuth

Types

type Mapper

type Mapper struct{}

func (Mapper) BuildPost

func (m Mapper) BuildPost(tweet anaconda.Tweet) *social.Post

func (Mapper) BuildPosts

func (m Mapper) BuildPosts(tweets []anaconda.Tweet) social.Posts

type OAuth

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

func (*OAuth) AuthCodeURL

func (oa *OAuth) AuthCodeURL(r *http.Request, claims map[string]interface{}) (string, error)

func (*OAuth) Exchange

func (oa *OAuth) Exchange(ctx context.Context, r *http.Request) ([]social.Credentials, error)

func (*OAuth) ProviderID

func (oa *OAuth) ProviderID() string

type Provider

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

func (*Provider) GetFeed

func (p *Provider) GetFeed(query providers.Query) (social.Posts, *providers.Cursor, error)

func (*Provider) GetFollowers

func (p *Provider) GetFollowers(query providers.Query) ([]*social.User, *providers.Cursor, error)

Get a user's followers Network docs: https://dev.twitter.com/rest/reference/get/followers/list

func (*Provider) GetFriends

func (p *Provider) GetFriends(query providers.Query) ([]*social.User, *providers.Cursor, error)

Get a user's friends (aka following) Network docs: https://dev.twitter.com/rest/reference/get/friends/list

func (*Provider) GetPosts

func (p *Provider) GetPosts(query providers.Query) (social.Posts, *providers.Cursor, error)

func (*Provider) GetUser

func (p *Provider) GetUser(query providers.Query) (*social.User, error)

func (*Provider) ID

func (p *Provider) ID() string

func (*Provider) Post

func (p *Provider) Post(ctx context.Context, msg string, shareLink string) (*social.Post, error)

Post a tweet to twitter

func (*Provider) Search

func (p *Provider) Search(query providers.Query) (social.Posts, *providers.Cursor, error)

Search Twitter via their REST API

type UserMapper

type UserMapper struct{}

func (UserMapper) BuildUser

func (m UserMapper) BuildUser(u anaconda.User) *social.User

func (UserMapper) BuildUsers

func (m UserMapper) BuildUsers(us []anaconda.User) []*social.User

Jump to

Keyboard shortcuts

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