Documentation
¶
Index ¶
- Constants
- Variables
- type Balance
- type Client
- func (c *Client) Community() (com *Community, err error)
- func (c *Client) Content(id int64, replyPage int) (ctt *Content, err error)
- func (c *Client) HasLoggedIn() bool
- func (c *Client) Hots() (topics []*Topic, err error)
- func (c *Client) Latest() (topics []*Topic, err error)
- func (c *Client) Member(name string) (mem *Member, err error)
- func (c *Client) Node(node string, page int) (list *List, err error)
- func (c *Client) Planes() (nodes []*Node, err error)
- func (c *Client) Profile() (pro *Profile, err error)
- func (c *Client) Recent(page int) (list *List, err error)
- func (c *Client) SetCookie(cookie string)
- func (c *Client) TopPlay() ([]*Leaderboard, error)
- func (c *Client) TopRich() ([]*Leaderboard, error)
- type Community
- type Content
- type Leaderboard
- type List
- type Member
- type Node
- type Postscript
- type Profile
- type Reply
- type Topic
Constants ¶
View Source
const ( URL_HOME = "https://www.v2ex.com" URL_NODE = URL_HOME + "/go/" URL_RECENT = URL_HOME + "/recent" URL_PLANES = URL_HOME + "/planes" URL_MEMBER = URL_HOME + "/member/" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
var DefaultClient *Client
func (*Client) HasLoggedIn ¶
type Community ¶
type Community struct {
// 首页右侧
Members int // 会员
Topics int // 主题
Comments int // 回复
// 首页底部
Version string // 版本
Online int // 当前在线
OnlineMax int // 最高在线
}
Community 社区数据
type Content ¶
type Content struct {
Topic *Topic
Body string
Clicks int
Favorites int
Thanks int
Postscripts []*Postscript
Replies []*Reply
ReplyTotal int
ReplyTime time.Time
ReplyPage int
ReplyPageMax int
}
Content 主题内容
type Leaderboard ¶
Leaderboard 排行榜 财富排行榜 https://www.v2ex.com/top/rich 消费排行榜 https://www.v2ex.com/top/player
type Member ¶
type Member struct {
Name string
Bio string
Avatar string
Number int
Join string
JoinTime time.Time
Rank int
Online bool
}
Member 会员数据 https://www.v2ex.com/member/livid
type Node ¶
Node 节点 https://www.v2ex.com/planes
type Postscript ¶
Postscript 主题附言
type Profile ¶
type Profile struct {
UserName string
UserUrl string
Avatar string
FavNodes int
FavTopics int
Following int
Notifications int
Balance *Balance
}
Profile 个人资料
Click to show internal directories.
Click to hide internal directories.