Add new routes for embedding tweets and handling status requests#1288
Add new routes for embedding tweets and handling status requests#1288cameronaaron wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds new routes for handling tweet status requests and embedding functionality. The changes enable direct access to tweet status pages via an alternative URL pattern and provide an embed endpoint for tweet status IDs.
- Adds a new route
/i/status/@id/?that handles tweet status requests with validation and rendering - Adds a new embed route
/i/status/@id/embedfor embedding tweets by status ID - Implements comprehensive tweet validation, media handling, and conversation rendering
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/routes/status.nim | Adds new status route with ID validation, media processing, and conversation rendering |
| src/routes/embed.nim | Adds new embed route for tweet status IDs with error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| let conv = await getTweet(id, getCursor()) | ||
| if conv == nil: | ||
| echo "nil conv" |
There was a problem hiding this comment.
Debug output should be removed or replaced with proper logging. Using echo for debugging in production code is not recommended.
| get "/i/status/@id/?": | ||
| let id = @"id" | ||
|
|
||
| if id.len > 19 or id.any(c => not c.isDigit): |
There was a problem hiding this comment.
The magic number 19 should be extracted to a named constant to clarify that this represents the maximum length of a tweet ID.
No description provided.