/
tinaya_bbs_feeling_comment.cfg.json
236 lines (236 loc) · 8.18 KB
/
tinaya_bbs_feeling_comment.cfg.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
{
"id": 22,
"name": "tinaya_bbs_feeling_comment",
"display_name": "天涯论坛-情感天地专区【跟帖】",
"remark": "",
"tags": "[]",
"start_urls": [
"http://bbs.tianya.cn/list-feeling-1.shtml"
],
"start_stage": "thread_list",
"cron": "",
"enable_cron": false,
"create_time": "2020-09-16T13:05:04.199639Z",
"update_time": "2020-09-16T14:46:56.155326Z",
"stages": [
{
"id": 497,
"project_id": 22,
"name": "thread_list",
"is_list": true,
"is_unique": false,
"list_xpath": "//div[contains(@class, \"mt5\")]/table/tbody/tr[count(th)=0]",
"list_css": "",
"page_xpath": "//a[@rel=\"nofollow\" and text()=\"下一页\"]/attribute::href",
"page_css": "",
"page_attr": "",
"plugins": "",
"plugin_array": null,
"fields": [
{
"id": 1878,
"project_id": 22,
"stage_id": 497,
"name": "thread_id",
"is_array": false,
"is_html": false,
"xpath": "//td[contains(@class, \"td-title\")]/a/attribute::href",
"css": "",
"attr": "",
"plugin": "get_thread_id@s4",
"_plugin": {
"id": 98,
"name": "get_thread_id",
"script": "(function(){\n // Plugin Name: get_thread_id\n // Start here...\n var val = ENV(\"currentFieldValue\");\n return REGEXP_GROUP_FIND(\".+-([0-9]+)-[0-9]+.+\", val, \"$1\")\n})()",
"slot": "s4",
"project_id": 22
},
"remark": "标题",
"next_stage": ""
},
{
"id": 1879,
"project_id": 22,
"stage_id": 497,
"name": "thread_url",
"is_array": false,
"is_html": false,
"xpath": "//td[contains(@class, \"td-title\")]/a/attribute::href",
"css": "",
"attr": "",
"plugin": "abs@s4",
"_plugin": {
"id": 99,
"name": "abs",
"script": "(function(){\n // Plugin Name: abs\n // Start here...\n return ABS(ENV(\"currentFieldValue\"));\n})()",
"slot": "s4",
"project_id": 22
},
"remark": "帖子url",
"next_stage": "thread_detail"
}
],
"has_next_stage": true
},
{
"id": 498,
"project_id": 22,
"name": "thread_detail",
"is_list": true,
"is_unique": false,
"list_xpath": "//div[@class=\"atl-item\"]",
"list_css": "",
"page_xpath": "",
"page_css": "",
"page_attr": "",
"plugins": "",
"plugin_array": null,
"fields": [
{
"id": 1880,
"project_id": 22,
"stage_id": 498,
"name": "content",
"is_array": false,
"is_html": true,
"xpath": "//div[@class=\"bbs-content\"]",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "帖子内容",
"next_stage": ""
},
{
"id": 1881,
"project_id": 22,
"stage_id": 498,
"name": "level",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/span[ends-with(text(), \"楼\")]",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "楼",
"next_stage": ""
},
{
"id": 1882,
"project_id": 22,
"stage_id": 498,
"name": "reply_count",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/a[contains(text(), \"评论(\")]",
"css": "",
"attr": "",
"plugin": "get_number@s4",
"_plugin": {
"id": 101,
"name": "get_number",
"script": "(function(){\n // Plugin Name: get_number\n // Start here...\n // 提取数字\n var val = ENV(\"currentFieldValue\");\n if (val==\"\") {\n \treturn \"0\"\n }\n return REGEXP_GROUP_FIND(\"[^\\\\d]*([0-9]+)[^\\\\d]*\", val, \"$1\")\n})()",
"slot": "s4",
"project_id": 22
},
"remark": "评论数",
"next_stage": ""
},
{
"id": 1883,
"project_id": 22,
"stage_id": 498,
"name": "comment_time",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/a[text()=\"举报\"]/attribute::replytime",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "评论时间",
"next_stage": ""
},
{
"id": 1884,
"project_id": 22,
"stage_id": 498,
"name": "uid",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/a[text()=\"举报\"]/attribute::authorid",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "评论用户id",
"next_stage": ""
},
{
"id": 1885,
"project_id": 22,
"stage_id": 498,
"name": "uname",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/a[text()=\"举报\"]/attribute::author",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "评论用户昵称",
"next_stage": ""
},
{
"id": 1886,
"project_id": 22,
"stage_id": 498,
"name": "replyid",
"is_array": false,
"is_html": false,
"xpath": "//div[@class=\"atl-reply\"]/a[text()=\"举报\"]/attribute::replyid",
"css": "",
"attr": "",
"plugin": "",
"_plugin": null,
"remark": "评论id",
"next_stage": ""
},
{
"id": 1887,
"project_id": 22,
"stage_id": 498,
"name": "sub_comments",
"is_array": false,
"is_html": false,
"xpath": "",
"css": "//xx",
"attr": "",
"plugin": "get_sub_comments@s4",
"_plugin": {
"id": 102,
"name": "get_sub_comments",
"script": "(function(){\n // Plugin Name: get_sub_comments\n // Start here...\n // 拉取跟帖的所有评论\n var rc = Number(MIDDLE_DATA().reply_count); // 评论数量,计算分页\n var tid = Number(MIDDLE_DATA().thread_id);\n var rid = Number(MIDDLE_DATA().replyid);\n if (rc \u0026\u0026 rc \u003e 0) {\n var page = rc != 0 \u0026\u0026 rc \u003e 10 ? (rc % 10 == 0 ? rc / 10 : rc / 10 + 1) : 1;\n var result = new Array();\n //console.log(\"rc=:\" + rc);\n //console.log(\"分页=\" + page);\n for (var i = 1; i \u003c= page; i++) {\n var url = \"http://bbs.tianya.cn/api?method=bbs.api.getCommentList\u0026params.item=feeling\u0026params.articleId=\"+ tid +\"\u0026params.replyId=\"+ rid +\"\u0026params.pageNum=\" + i;\n \t//console.log(\"+++++++++++++++++++++++++++=\");\n //console.log(url);\n var ret = AJAX(\"GET\", url, \n {\n \t\"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36\"\n }, {}, null);\n //console.log(JSON.stringify(ret));\n \n if (ret.status == 200) {\n var resp = JSON.parse(ret.data);\n if (resp.success == \"1\") {\n \t//console.log(JSON.stringify(resp.data));\n for (var k = 0; k \u003c resp.data.length; k++) {\n \tresult.push(resp.data[k]);\n }\n }\n }\n }\n return JSON.stringify(result);\n }\n return \"\"\n})()",
"slot": "s4",
"project_id": 22
},
"remark": "所有子评论",
"next_stage": ""
}
],
"has_next_stage": false
}
],
"headers": {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36"
},
"settings": {
"CONCURRENT_REQUESTS": "5"
},
"node_affinity": [
""
],
"node_affinity_parsed": null,
"extras": null
}