[site]
name = "twitter"
patterns = ["(?i)(?:x|twitter)\\.com/.+/status/\\d+"]
[rewrite]
from = "(?i)https?://(?:x|twitter)\\.com/([^/?#]+)/status/(\\d+).*"
to = "https://api.fxtwitter.com/$1/status/$2"
[request]
accept = "application/json"
success_path = ".tweet"
[json]
author_name = ".tweet.author.name"
author_handle = ".tweet.author.screen_name"
text = ".tweet.text"
date = ".tweet.created_at"
url = ".tweet.url"
likes = ".tweet.likes"
retweets = ".tweet.retweets"
replies = ".tweet.replies"
views = ".tweet.views"
article_title = ".tweet.article.title"
article_preview = ".tweet.article.preview_text"
article_content = ".tweet.article.content.blocks[].text"
[template]
format = """
## @{author_handle} ({author_name})
# {article_title}
{article_content}
{text}
๐ {likes|number} likes ยท {retweets|number} reposts ยท {replies|number} replies
๐ {views|number} views
๐ {date}
[View on X]({url})
"""
[metadata]
platform = "Twitter/X"
author = "{author_name} (@{author_handle})"
title_field = ""
published_field = "date"
canonical_url_field = "url"
[engagement]
likes = "likes"
reposts = "retweets"
replies = "replies"
views = "views"