|
@@ -230,23 +230,25 @@ type WeiboPostsResponse struct {
|
|
Data struct {
|
|
Data struct {
|
|
Cards []struct {
|
|
Cards []struct {
|
|
Mblog struct {
|
|
Mblog struct {
|
|
- Id string `json:"id"`
|
|
|
|
- Text string `json:"text"`
|
|
|
|
- CreatedAt string `json:"created_at"`
|
|
|
|
- AttitudesCount int `json:"attitudes_count"` // 点赞数
|
|
|
|
- CommentsCount int `json:"comments_count"` // 评论数
|
|
|
|
- RepostsCount int `json:"reposts_count"` // 转发数
|
|
|
|
- PendingApproval int `json:"pending_approval"` // 待审数
|
|
|
|
- PicIds []string `json:"pic_ids"` // 图片ID列表
|
|
|
|
- PageInfo struct {
|
|
|
|
- Type string `json:"type"` // 内容类型(video/article)
|
|
|
|
- PagePic struct {
|
|
|
|
- Url string `json:"url"` // 封面图URL
|
|
|
|
- } `json:"page_pic"`
|
|
|
|
- MediaInfo struct {
|
|
|
|
- StreamUrl string `json:"stream_url"` // 视频流地址
|
|
|
|
- } `json:"media_info"`
|
|
|
|
- } `json:"page_info"`
|
|
|
|
|
|
+ RetweetedStatus struct {
|
|
|
|
+ Id string `json:"id"`
|
|
|
|
+ Text string `json:"text"`
|
|
|
|
+ CreatedAt string `json:"created_at"`
|
|
|
|
+ AttitudesCount int `json:"attitudes_count"` // 点赞数
|
|
|
|
+ CommentsCount int `json:"comments_count"` // 评论数
|
|
|
|
+ RepostsCount int `json:"reposts_count"` // 转发数
|
|
|
|
+ PendingApproval int `json:"pending_approval"` // 待审数
|
|
|
|
+ PicIds []string `json:"pic_ids"` // 图片ID列表
|
|
|
|
+ PageInfo struct {
|
|
|
|
+ Type string `json:"type"` // 内容类型(video/article)
|
|
|
|
+ PagePic struct {
|
|
|
|
+ Url string `json:"url"` // 封面图URL
|
|
|
|
+ } `json:"page_pic"`
|
|
|
|
+ MediaInfo struct {
|
|
|
|
+ StreamUrl string `json:"stream_url"` // 视频流地址
|
|
|
|
+ } `json:"media_info"`
|
|
|
|
+ } `json:"page_info"`
|
|
|
|
+ } `json:"retweeted_status"`
|
|
} `json:"mblog"`
|
|
} `json:"mblog"`
|
|
} `json:"cards"`
|
|
} `json:"cards"`
|
|
} `json:"data"`
|
|
} `json:"data"`
|
|
@@ -284,7 +286,7 @@ func parseWeiboPosts(body []byte) ([]WeiboPostStats, error) {
|
|
break
|
|
break
|
|
}
|
|
}
|
|
|
|
|
|
- mblog := card.Mblog
|
|
|
|
|
|
+ mblog := card.Mblog.RetweetedStatus
|
|
hasVideo := mblog.PageInfo.Type == "video"
|
|
hasVideo := mblog.PageInfo.Type == "video"
|
|
|
|
|
|
posts = append(posts, WeiboPostStats{
|
|
posts = append(posts, WeiboPostStats{
|
|
@@ -303,6 +305,7 @@ func parseWeiboPosts(body []byte) ([]WeiboPostStats, error) {
|
|
return posts, nil
|
|
return posts, nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// GetWeiBoHistoryList 微博历史作品数据
|
|
func GetWeiBoHistoryList(ctx context.Context, homePageUrl string) ([]WeiboPostStats, error) {
|
|
func GetWeiBoHistoryList(ctx context.Context, homePageUrl string) ([]WeiboPostStats, error) {
|
|
url := "http://120.46.92.62:6888/api/weibo/user_post" // 替换为实际API地址
|
|
url := "http://120.46.92.62:6888/api/weibo/user_post" // 替换为实际API地址
|
|
method := "POST"
|
|
method := "POST"
|