weibo

package module
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

A Go library for Weibo tweet monitoring. 一个用于监测微博推文的 Go 库。

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadRequest = errors.New("BadRequest")

Functions

func DefaultCheck added in v1.1.2

func DefaultCheck() (check checkCookie)

func DownPic added in v1.1.1

func DownPic(c *Client, pic string, picUrl string, path string) error

func ExistedOrDownPic added in v1.1.1

func ExistedOrDownPic(c *Client, mblog *Mblog, path string) error

Types

type ActionInfo added in v1.1.3

type ActionInfo struct {
	Comment *Comment `json:"comment"`
}

type CMblog added in v1.1.3

type CMblog struct {
	CreatedAt   string      `json:"created_at"`
	ID          string      `json:"id"`
	Text        string      `json:"text"`
	PicIds      []string    `json:"pic_ids"`
	User        *User       `json:"user"`
	IsLongText  bool        `json:"isLongText"`
	ActionInfo  *ActionInfo `json:"action_info"`
	PicNum      int8        `json:"pic_num"`
	MblogID     string      `json:"bid"`
	Pics        []*Pics     `json:"pics,omitempty"`
	Retweeted   *CMblog     `json:"retweeted_status,omitempty"`
	LongTextRaw string
}

func (*CMblog) TheText added in v1.1.3

func (m *CMblog) TheText() string

type CMblogBody added in v1.1.3

type CMblogBody struct {
	Data struct {
		Cards []*Card `json:"cards"`
	} `json:"data"`
	Ok  int    `json:"ok"`
	Msg string `json:"msg,omitempty"`
}

type Card added in v1.1.3

type Card struct {
	CardType  int8         `json:"card_type"`
	ShowType  int8         `json:"show_Type"`
	CardGroup []*CardGroup `json:"card_group,omitempty"`
	Mblog     CMblog       `json:"mblog,omitempty"`
}

type CardGroup added in v1.1.3

type CardGroup struct {
	CardType int8   `json:"card_type"`
	ShowType int8   `json:"show_Type"`
	Mblog    CMblog `json:"mblog"`
}

type Client

type Client struct {
	Cookie string
	Proxy  string
	Check  checkCookie
}

func (*Client) AddFriend added in v1.1.2

func (c *Client) AddFriend(uid string) (err error)

func (*Client) CheckCookie added in v1.1.2

func (c *Client) CheckCookie() (isActivate bool, err error)

func (*Client) DownPics added in v1.1.0

func (c *Client) DownPics(mblog *Mblog, path string) error

func (*Client) DownPicsByUrl added in v1.1.5

func (c *Client) DownPicsByUrl(name []string, urls []string, path string) error

func (*Client) FetchCMblogLongText added in v1.1.3

func (c *Client) FetchCMblogLongText(mblog *CMblog) error

func (*Client) FetchMblogLongText

func (c *Client) FetchMblogLongText(mblog *Mblog) error

func (*Client) GetCMblogs added in v1.1.3

func (c *Client) GetCMblogs(userid string, page int, longtext bool) ([]*CMblog, error)

获取互动信息,需要cookie

func (*Client) GetMMblogs added in v1.1.4

func (c *Client) GetMMblogs(userid string, page int, longtext bool) ([]*CMblog, error)

手机端api,获取全部微博,需要cookie

func (*Client) GetMblogLongText

func (c *Client) GetMblogLongText(mblogid string) (longtext string, err error)

func (*Client) GetMblogs

func (c *Client) GetMblogs(userid string, page int, longtext bool) ([]*Mblog, error)

type Comment added in v1.1.3

type Comment struct {
	List  []*CommentBlog `json:"list"`
	Count int64          `json:"count"`
}

type CommentBlog added in v1.1.3

type CommentBlog struct {
	CreatedAt string `json:"created_at"`
	ID        int64  `json:"id"`
	Text      string `json:"text"`
	User      *User  `json:"user"`
}

type Database

type Database struct {
	DN  string
	DSN string
	// contains filtered or unexported fields
}

func (*Database) AddMblog

func (database *Database) AddMblog(mblog *Mblog) error

func (*Database) Close

func (database *Database) Close()

func (*Database) HasMblog

func (database *Database) HasMblog(mblog *Mblog) (bool, error)

func (*Database) Migrate

func (database *Database) Migrate() error

type Large added in v1.1.3

type Large struct {
	Url string `json:"url"`
}

type LongtextBody

type LongtextBody struct {
	Data struct {
		LongTextContent string `json:"longTextContent"`
	} `json:"data"`
	Ok int `json:"ok"`
}

type Mblog

type Mblog struct {
	User         *User                  `json:"user"`
	CreatedAt    string                 `json:"created_at"`
	ID           int64                  `json:"id"`
	MblogID      string                 `json:"mblogid"`
	TextRaw      string                 `json:"text_raw"`
	Text         string                 `json:"text"`
	IsLongText   bool                   `json:"isLongText"`
	PicNum       int8                   `json:"pic_num"`
	PicIds       []string               `json:"pic_ids"`
	PicInfos     map[string]interface{} `json:"pic_infos"`
	MixMediaInfo map[string]interface{} `json:"mix_media_info"`
	Retweeted    *Mblog                 `json:"retweeted_status,omitempty"`
	LongTextRaw  string
}

func (*Mblog) PicUrls added in v1.1.1

func (m *Mblog) PicUrls() map[string]interface{}

func (*Mblog) String

func (mblog *Mblog) String() string

func (*Mblog) TheText

func (m *Mblog) TheText() string

type MymblogBody

type MymblogBody struct {
	Data struct {
		List []*Mblog `json:"list"`
	} `json:"data"`
	Ok int `json:"ok"`
}

type Pics added in v1.1.3

type Pics struct {
	Pid   string `json:"pid"`
	Url   string `json:"url"`
	Large *Large `json:"large"`
}

type User

type User struct {
	ID     int64  `json:"id"`
	Name   string `json:"screen_name"`
	Icon   string `json:"avatar_large"`
	Remark string `json:"remark"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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