juejin

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEditorType = 10

	DefaultHTMLContent = "deprecated"
)
View Source
const (
	DefaultBaseAPI = "https://api.juejin.cn"
)
View Source
const StartCursor = "0"

Variables

This section is empty.

Functions

func BuildArticleURL

func BuildArticleURL(id string) string

Types

type APIError

type APIError struct {
	ErrMsg string `json:"err_msg"`
	ErrNo  int    `json:"err_no"`
}

type Article

type Article struct {
	ID   string       `json:"article_id"`
	Info *ArticleInfo `json:"article_info"`
}

type ArticleInfo

type ArticleInfo struct {
	ID      string `json:"article_id"`
	DraftID string `json:"draft_id"`
}

type Badge

type Badge struct {
	ID        string `json:"badge_id"`
	Name      string `json:"badge_name"`
	BeginTime int64  `json:"begin_time"`
	EndTime   int64  `json:"end_time"`
	ImageURL  string `json:"image_url"`
	Priority  int    `json:"priority"`
	Requires  string `json:"requires"`
	SeriesID  string `json:"series_id"`
}

type Badges

type Badges struct {
	ObtainBadges []*Badge `json:"obtain_badges"`
	LinkURL      string   `json:"link_url"`
	ObtainCount  int      `json:"obtain_count"`
	ShowBadge    bool     `json:"show_badge"`
	WearBadges   []*Badge `json:"wear_badges"`
}

type Category

type Category struct {
	ID   string `json:"category_id"`
	Name string `json:"category_name"`
}

type CategoryItem added in v1.0.0

type CategoryItem struct {
	ID       string    `json:"category_id"`
	Category *Category `json:"category"`
}

type Client

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

func (*Client) Auth added in v1.0.0

func (c *Client) Auth(cookie string) (string, error)

func (*Client) Name added in v1.0.0

func (c *Client) Name() string

func (*Client) NewArticle added in v1.0.2

func (c *Client) NewArticle(r io.Reader) error

func (*Client) Publish added in v1.0.0

func (c *Client) Publish() (string, error)

type Column added in v1.0.3

type Column struct {
	ColumnVersion struct {
		Title string `json:"title"`
	} `json:"column_version"`
	ColumnID string `json:"column_id"`
}

type GetUserResponse

type GetUserResponse struct {
	Data *User `json:"data"`
	APIError
}

type ListColumnsRequest added in v1.0.3

type ListColumnsRequest struct {
	Cursor  string `json:"cursor"`
	Keyword string `json:"keyword"`
	Limit   int    `json:"limit"`
	UserID  string `json:"user_id"`
}

type Tag

type Tag struct {
	ID   int    `json:"id"`
	Name string `json:"tag_name"`
}

type TagItem added in v1.0.0

type TagItem struct {
	ID  string `json:"tag_id"`
	Tag *Tag   `json:"tag"`
}

type User

type User struct {
	ID                string `json:"user_id"`
	Name              string `json:"user_name"`
	Administrator     int    `json:"administrator"`
	AvatarLarge       string `json:"avatar_large"`
	BlogAddress       string `json:"blog_address"`
	Power             int    `json:"power"` // 掘力值
	WechatNickname    string `json:"wechat_nickname"`
	WechatVerified    int    `json:"wechat_verified"`
	WeiboID           string `json:"weibo_id"`
	WeiboNickname     string `json:"weibo_nickname"`
	WeiboVerified     int    `json:"weibo_verified"`
	Level             int    `json:"level"`          // 等级
	GotViewCount      int    `json:"got_view_count"` // 文章被阅读
	GotDiggCount      int    `json:"got_digg_count"` // 文章被点赞
	FolloweeCount     int    `json:"followee_count"` // 关注了
	FollowerCount     int    `json:"follower_count"` // 关注者
	GithubNickname    string `json:"github_nickname"`
	GithubVerified    int    `json:"github_verified"`
	Description       string `json:"description"`
	CanTagCount       int    `json:"can_tag_cnt"`
	BuyBookletCount   int    `json:"buy_booklet_count"`
	PostArticleCount  int    `json:"post_article_count"`  // 发布文章数
	PostShortmsgCount int    `json:"post_shortmsg_count"` // 发布沸点数
	RegisterTime      int64  `json:"register_time"`
	SubscribeTagCount int    `json:"subscribe_tag_count"` // 关注标签
	ViewArticleCount  int    `json:"view_article_count"`
	DiggArticleCount  int    `json:"digg_article_count"`  // 点赞文章数
	DiggShortmsgCount int    `json:"digg_shortmsg_count"` // 点赞沸点数
	DiggNewsCount     int    `json:"digg_news_count"`     // 点赞资讯数
	UpdateTime        int64  `json:"update_time"`
}

Jump to

Keyboard shortcuts

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