Skip to content

Commit

Permalink
add links of tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
iazzenma committed Aug 17, 2024
1 parent c428124 commit 6a6a002
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/birdxplorer_api/routers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def get_posts(

total_count = len(posts)
paginated_posts = posts[offset : offset + limit]
for post in paginated_posts:
post.link = f"https://x.com/{post.x_user.name}/status/{post.post_id}"


base_url = str(request.url).split("?")[0]
next_offset = offset + limit
prev_offset = max(offset - limit, 0)
Expand Down
1 change: 1 addition & 0 deletions common/birdxplorer_common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ class XUser(BaseModel):


class Post(BaseModel):
link: HttpUrl
post_id: PostId
x_user_id: UserId
x_user: XUser
Expand Down

0 comments on commit 6a6a002

Please sign in to comment.