feat: Add Space Search functionality and documentation#835
feat: Add Space Search functionality and documentation#835lekkerelou wants to merge 3 commits intoRishikant181:devfrom
Conversation
Signed-off-by: LekkereLou <29013180+lekkerelou@users.noreply.github.com>
Signed-off-by: LekkereLou <29013180+lekkerelou@users.noreply.github.com>
|
@lekkerelou I've added a comment. If possible, please address that and we'll be good to merge. Thanks! |
|
I don't see any comment on my PR |
| const spaceIds = SpaceService._extractSpaceIds(searchResults.list); | ||
|
|
||
| // Fetching details for each space id | ||
| const spaces = await Promise.all( |
There was a problem hiding this comment.
We should not be nesting one API call within another, in this case, space.details within space.search. Let's say a search result returns 20 spaces, this implementation will results in a total of 21 API calls (1 for initial search result and 20 for each space result). Almost all functions of Rettiwt represent 1:1 API calls i.e, one function call results in one API call. This is done so that we leave as much freedom to the user as possible, in regards to rate limiting.
I'm curious, what does the search result for spaces look like? Is it truncated that we have to fetch the details again? If that's the case, we should return the truncated results (define additional type if necessary) from the space.search function, and leave it up to the user whether to fetch full details via space.details or not.
|
@lekkerelou I forgot to submit review lol. You should be able to see it now. |
|
What's the best? Using the Tweet structure: And they can fetch the space with the spaceId. or we setup a "SpaceSearch" Object: What's the best? |
|
@lekkerelou From the raw response, it seems like space search raw results are nothing but raw tweets, which happen to contain space information. So it makes sense that space search results return array of So, we can just add a new optional field called On that note, we also don't need to separate |
There was a problem hiding this comment.
On further thought, I've come to conclude that we don't even need the additional SPACE_SEARCH resource. We can just simplify this to adding an additional TweetFilter option called space, which can be either true or false/undefined.
If space filter option is set to true while searching for tweets using tweet.search, it will get all tweets which reference a space. The space URL will be then available in the entities.urls field of the tweet.search results.
|
Alright, will send a new commit with the changes |
🔗 Related Issue
N/A
❓ Type of Change
📚 Description
feat: Add Space Search functionality and documentation
node dist/cli.js space search tbvxyz
📝 Checklist
@Rishikant181