Skip to content

feat(twitter): add time column to search output#473

Merged
jackwener merged 2 commits intojackwener:mainfrom
voidborne-d:feat/twitter-search-time
Mar 26, 2026
Merged

feat(twitter): add time column to search output#473
jackwener merged 2 commits intojackwener:mainfrom
voidborne-d:feat/twitter-search-time

Conversation

@voidborne-d
Copy link
Copy Markdown

Summary

Adds a time column to the twitter search command output, showing when each tweet was posted.

Changes

  • Extract created_at from tweet.legacy.created_at (RFC 2822 format)
  • Parse into ISO-like YYYY-MM-DD HH:MM:SS for readability
  • Add time column between text and likes in output
  • Graceful fallback: keeps raw string if date parsing fails

Why

When monitoring trending topics, users need timestamps to filter out old tweets. Without this field, there is no way to distinguish a tweet from today vs. one from last week.

Example output with the new column:

id          author    text              time                 likes  views  url
192837465   @user1    Breaking news...  2026-03-26 10:30:00  42     1200   https://x.com/...

Closes #465

Extract created_at from tweet data and format as ISO datetime.
This helps users filter tweets by recency during monitoring.

Closes jackwener#465
@Astro-Han
Copy link
Copy Markdown
Contributor

Nice addition, timestamps for search results make a lot of sense. A couple of things I noticed:

Field naming: the other twitter commands (timeline, likes, bookmarks, thread, profile) all use created_at for the same concept. Using time here means JSON output keys differ across commands, which could trip up scripting.

UTC without timezone indicator: toISOString().slice(0, 19) produces UTC time but drops the Z suffix, so 2026-03-26 10:30:00 looks like local time but is actually UTC. The comment also says "local timestamp" which adds to the confusion. Keeping Z or noting "UTC" in the column name might help.

Both are minor, the core change is solid.

@jackwener jackwener merged commit 776674c into jackwener:main Mar 26, 2026
@jackwener jackwener mentioned this pull request Mar 26, 2026
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.

[Feature]: add time field to twitter cmd.

3 participants