weibo

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 8 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

This section is empty.

Types

type Client

type Client struct {
	Cookie string
	Proxy  string
}

func (*Client) DownPics added in v1.1.0

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

func (*Client) FetchMblogLongText

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

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 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 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"`
	Retweeted   *Mblog                 `json:"retweeted_status,omitempty"`
	LongTextRaw string
}

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 User

type User struct {
	ID   int64  `json:"id"`
	Name string `json:"screen_name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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