Skip to content

Conversation

@grantdfoster
Copy link
Collaborator

  • improves mapping in tweet handler to correctly map public metrics

Copilot AI review requested due to automatic review settings October 29, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Twitter scraper's tweet conversion function to populate additional fields that align with the TwitterX API format. The changes add AuthorID, PublicMetrics, and PossiblySensitive fields to ensure consistent data structure between scraper-based and API-based tweet results.

  • Maps scraper tweet fields to the unified PublicMetrics structure
  • Adds AuthorID field populated from UserID
  • Maps SensitiveContent to PossiblySensitive for API consistency
Comments suppressed due to low confidence (1)

internal/jobs/twitter.go:318

  • The TwitterX API conversion is missing the ImpressionCount field, which is available in TwitterXTweetMetrics (line 199 in twitterx/scraper.go). For consistency with the scraper conversion added in this PR (line 88), add ImpressionCount: tX.PublicMetrics.ImpressionCount to this struct initialization.
			newTweet.PublicMetrics = types.PublicMetrics{
				RetweetCount:  tX.PublicMetrics.RetweetCount,
				ReplyCount:    tX.PublicMetrics.ReplyCount,
				LikeCount:     tX.PublicMetrics.LikeCount,
				QuoteCount:    tX.PublicMetrics.QuoteCount,
				BookmarkCount: tX.PublicMetrics.BookmarkCount,
			}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@grantdfoster grantdfoster merged commit fdba7b0 into main Oct 30, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants