api

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	CurrentUser *User
	// contains filtered or unexported fields
}

API : TwitterAPI

func New

func New(ct *oauth1.Token, u *User) (*API, error)

New : 新規作成

func (*API) Auth

func (a *API) Auth(client *oauth1.Token) (*User, error)

Auth : アプリケーション認証を行なって、ユーザ情報とトークンを取得

func (*API) Block

func (a *API) Block(userID string) error

Block : ユーザをブロック

func (*API) DeleteTweet

func (a *API) DeleteTweet(tweetID string) error

DeleteTweet : ツイートを削除

func (*API) FetchHomeTileline

func (a *API) FetchHomeTileline(userID, sinceID string, results int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

FetchHomeTileline : ホームタイムラインを取得

func (*API) FetchLikedTweets

func (a *API) FetchLikedTweets(userID string, maxResults int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

FetchLikedTweets : ユーザのいいねしたツイートを取得

func (*API) FetchListTweets

func (a *API) FetchListTweets(listID string, results int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

FetchListTweets : リスト内のツイートを取得

func (*API) FetchOwnedLists

func (a *API) FetchOwnedLists(userID string) ([]*twitter.ListObj, error)

FetchOwnedLists : ユーザが所有するリストの情報を取得

func (*API) FetchUser

func (a *API) FetchUser(userNames []string) ([]*UserDictionary, error)

FetchUser : UserNameからユーザ情報を取得

func (*API) FetchUserMentionTimeline

func (a *API) FetchUserMentionTimeline(userID, sinceID string, results int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

FetchUserMentionTimeline : ユーザのメンションタイムラインを取得

func (*API) FetchUserTimeline

func (a *API) FetchUserTimeline(userID, sinceID string, results int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

FetchUserTimeline : ユーザタイムラインを取得

func (*API) Follow

func (a *API) Follow(userID string) error

Follow : ユーザをフォロー

func (*API) Like

func (a *API) Like(tweetID string) error

Like : いいね

func (*API) Mute

func (a *API) Mute(userID string) error

Mute : ユーザをミュート

func (*API) PostTweet

func (a *API) PostTweet(text, quoteID, replyID string, mediaIDs []string) error

PostTweet : ツイートを投稿

func (*API) Retweet

func (a *API) Retweet(tweetID string) error

Retweet : リツイート

func (*API) SearchRecentTweets

func (a *API) SearchRecentTweets(query, sinceID string, results int) ([]*twitter.TweetDictionary, *twitter.RateLimit, error)

SearchRecentTweets : ツイートを検索

func (*API) UnBlock

func (a *API) UnBlock(userID string) error

UnBlock : ユーザのブロックを解除

func (*API) UnFollow

func (a *API) UnFollow(userID string) error

UnFollow : ユーザのフォローを解除

func (*API) UnLike

func (a *API) UnLike(tweetID string) error

UnLike : いいねを解除

func (*API) UnMute

func (a *API) UnMute(userID string) error

UnMute : ユーザのミュートを解除

func (*API) UnRetweet

func (a *API) UnRetweet(tweetID string) error

UnRetweet : リツイートを解除

func (*API) UploadImage

func (a *API) UploadImage(rawImage []byte) (*UploadImageResponse, error)

UploadImage : 画像をアップロード

type Image

type Image struct {
	ImageType string `json:"image_type"`
	W         int    `json:"w"`
	H         int    `json:"h"`
}

Image : 画像詳細

type UploadImageResponse

type UploadImageResponse struct {
	MediaID          int    `json:"media_id"`
	MediaIDString    string `json:"media_id_string"`
	Size             int    `json:"size"`
	ExpiresAfterSecs int    `json:"expires_after_secs"`
	Image            Image  `json:"image"`
}

UploadImageResponse : media/uploadのレスポンス

type User

type User struct {
	UserName string
	ID       string
	Token    *oauth1.Token
}

User : ユーザ情報

type UserDictionary

type UserDictionary struct {
	User        *twitter.UserObj
	PinnedTweet *twitter.TweetDictionary
}

UserDictionary : twitter.UserDictionary の独自実装

Jump to

Keyboard shortcuts

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