Enabled premium users to query to bookmark folders and their respective tweets#815
Conversation
|
@andre-cavalheiro Thanks for PR! I look at it over the weekend. |
|
Take your time, just don't forget 🙏 |
|
@Rishikant181, let me know if you want me to test it with my premium account |
|
@andre-cavalheiro Sorry for the very long delay. Got caught up in work and then went on a vacation. I'm still afk. @vachmara If you can, please test it out. If tests go through, I'll merge this. |
| USER_BOOKMARK_FOLDER_TWEETS: (response: IUserBookmarkFolderTweetsResponse): CursoredData<Tweet> => | ||
| new CursoredData<Tweet>(response, BaseType.TWEET), |
There was a problem hiding this comment.
I'm not able to deserialize the tweets, maybe it's a different CursoredData object?
[Rettiwt-API] [2026-01-06T14:21:44.192Z] [REQUEST] {"resource":"USER_BOOKMARK_FOLDER_TWEETS","args":{"id":"1962078514531754373","count":20}}
[Rettiwt-API] [2026-01-06T14:21:44.192Z] [AUTHORIZATION] {"authenticated":true}
[Rettiwt-API] [2026-01-06T14:21:44.193Z] [VALIDATE] {"target":"FETCH_ARGS"}
[Rettiwt-API] [2026-01-06T14:21:44.193Z] [GET] {"target":"USER_CREDENTIAL"}
[Rettiwt-API] [2026-01-06T14:21:45.566Z] [DESERIALIZE] {"id":"1990109109446721774"}
D:\Projet\Rettiwt-API\dist\models\data\User.js:39
this.createdAt = new Date(user.legacy.created_at).toISOString();
^
RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at new User (D:\Projet\Rettiwt-API\dist\models\data\User.js:39:59)
at new Tweet (D:\Projet\Rettiwt-API\dist\models\data\Tweet.js:44:24)
at Tweet.timeline (D:\Projet\Rettiwt-API\dist\models\data\Tweet.js:198:29)
at new CursoredData (D:\Projet\Rettiwt-API\dist\models\data\CursoredData.js:30:39)
at Object.USER_BOOKMARK_FOLDER_TWEETS (D:\Projet\Rettiwt-API\dist\collections\Extractors.js:51:48)
at UserService.bookmarkFolderTweets (D:\Projet\Rettiwt-API\dist\services\public\UserService.js:145:55)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///D:/Projet/Rettiwt-API/playground/index.js:11:16There was a problem hiding this comment.
I know this issue: it's because of the created_at field being moved to a different location in the raw data from some endpoints. It has been addressed after the PR was opened.
@andre-cavalheiro Can you update your PR with latest changes from the dev branch? That should resolve this issue.
There was a problem hiding this comment.
I'll try with pulling the dev branch too!
There was a problem hiding this comment.
Just rebased :)
Lmk if you need anything else
b1cca32 to
cec1c40
Compare
|
@vachmara Did it work? |
Yes! All good on my side |
|
@andre-cavalheiro @vachmara Thanks! |
|
Was waiting for this one before releasing |
🔗 Related Issue
Closes #814
❓ Type of Change
📚 Description
This PR adds read-only support for Twitter/X bookmark folders, enabling users to:
New API Methods:
rettiwt.user.bookmarkFolders(cursor?)- ReturnsCursoredData<BookmarkFolder>rettiwt.user.bookmarkFolderTweets(folderId, count?, cursor?)- ReturnsCursoredData<Tweet>New CLI Commands:
rettiwt user bookmark-folders [cursor]rettiwt user bookmark-folder-tweets <folderId> [count] [cursor]New Types/Models:
BookmarkFolderclass withidandnamepropertiesIBookmarkFolderinterface📝 Checklist
Example
API:
CLI:
@Rishikant181