Skip to content

Commit a760b5f

Browse files
committed
rednote: skip the user hover_card which do not have any content; add testing note that we have no rednote account to test with at this time.
1 parent 450f541 commit a760b5f

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎modules/rednote.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ export function capture(response, source_platform_url, source_url) {
3838
return item;
3939
}
4040

41-
// user pages
42-
if(item.hasOwnProperty('type') && item['type'] === 'video' && item.hasOwnProperty('note_id')) {
41+
// user pages and saved-post boards; require 'user' to skip the previews
42+
// of someone's posts shown when hovering over their name
43+
// (user/hover_card), which have the same keys but no author or content
44+
if(item.hasOwnProperty('type') && item['type'] === 'video' && item.hasOwnProperty('note_id') && item.hasOwnProperty('user')) {
4345
item['id'] = item['note_id'];
4446
return item;
4547
}

‎tests/README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ but you can also pass one with the `--profiledir` argument. Log in to the
3838
various sites (Instagram, etc) in your 'normal' Firefox, and the tests then
3939
borrow that login.
4040

41+
RedNote (Xiaohongshu) is the exception: an account needs a Chinese phone
42+
number, and no current developer has one, so all RedNote development and
43+
testing is done logged out. Logged out, search redirects to the login page,
44+
saved-post boards are empty, and profile pages show only their first 12
45+
posts, without post IDs. Anything that needs a login can only be checked
46+
against items researchers have already collected and uploaded to 4CAT.
47+
RedNote also limits logged-out browsing: after enough page views, every page
48+
redirects to the login page, even after clearing cookies.
49+
4150
Run `test.py` to run tests. Required non-standard libraries are in
4251
`requirements.txt`.
4352

0 commit comments

Comments
 (0)