[Create a high-quality CSDN hot list comment area] Obtain the blog post data of the hot list comment area through the interface

Hello everyone, I am Dou Xiaojiang.

1. Column background

As an old user of CSDN, since CSDN emphasized the need to create a high-quality comment area, there is still room for improvement in the hot list comment area. Therefore, in this column, we will combine AI and explore some methods to improve the quality of the comment area.
This column is only the blogger’s idea and is used for technical learning and has nothing to do with the official website!

2. Get hot list data

Only by knowing yourself and the enemy can you fight without danger.
Let’s first get the data on the hot list.
Open the csdn official homepage: https://www.csdn.net
Insert image description here
Open the console - network to view network request data. In order to filter dynamically loaded data, we check Fetch/XHR filtering, which can quickly lock an interface /phoenix/web/blog/hot-rankthat is the hot list data. Obtain interface
This interface is unauthenticated. You can directly enter the uri in the browser search window to obtain the data: Hot list interface
Insert image description here
Note: The FeHelper plug-in is used here to optimize the json display.

3. Get comment area data

From the previous interface, it is easy to get. The productId returned by the interface is the ID of the article. The link to the article details page is https://blog.csdn.net/{userName}/article/details/{productId}.
Well, actually the articleDetailUrl field has the complete url address.

// 热榜数据接口部分字段
 {
    
    
    "userName": "xxx",
    "articleDetailUrl": "https://blog.csdn.net/user_name/article/details/product_id",
    "productId": "124"
}

Refresh the article details page and view the request list. You can quickly find the interface address for obtaining the comment list:/phoenix/web/v1/comment/list/{product_id}

Insert image description here
Okay, that’s it for the preliminary data preparation!
If you like it, follow this column so you don’t get lost. Continue in the next issue!

Next issue: [Create a high-quality CSDN hot list comment area] Let AI score the comments!

Guess you like

Origin blog.csdn.net/weixin_44778151/article/details/135037034