feat: add Xquik as X/Twitter search source

Add Xquik (xquik.com) as a new X/Twitter search source that uses a REST
API with full engagement metrics (likes, retweets, replies, quotes,
views, bookmarks). Uses stdlib urllib only -- no new dependencies.

- scripts/lib/xquik.py: source module with search, parse, query expansion
- tests/test_xquik.py: 32 unit tests covering all functions
- env.py: XQUIK_API_KEY config and availability check
- pipeline.py: source registration and retrieve dispatch
- normalize.py: reuses _normalize_x (same item format as Bird)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Burak Bayır
2026-04-09 22:44:10 +03:00
parent 45f596ca0c
commit 6b3de9170e
5 changed files with 530 additions and 0 deletions
+12
View File
@@ -39,6 +39,7 @@ from . import (
truthsocial,
xai_x,
xiaohongshu_api,
xquik,
youtube_yt,
)
from .cluster import cluster_candidates
@@ -56,6 +57,7 @@ SEARCH_ALIAS = {
"truth": "truthsocial",
"web": "grounding",
"xhs": "xiaohongshu",
"xquik": "xquik",
}
MAX_SOURCE_FETCHES: dict[str, int] = {"x": 2}
@@ -74,6 +76,7 @@ MOCK_AVAILABLE_SOURCES = [
"xiaohongshu",
"github",
"perplexity",
"xquik",
]
@@ -117,6 +120,8 @@ def available_sources(config: dict[str, Any], requested_sources: list[str] | Non
available.append("threads")
if requested_sources and "pinterest" in requested_sources and env.is_pinterest_available(config):
available.append("pinterest")
if env.is_xquik_available(config):
available.append("xquik")
return available
@@ -930,6 +935,13 @@ def _retrieve_stream(
), {}
if source == "perplexity":
return perplexity.search(subquery.search_query, date_range, config, deep=config.get("_deep_research", False))
if source == "xquik":
result = xquik.search_xquik(
subquery.search_query, from_date, to_date,
depth=depth,
token=env.get_xquik_token(config),
)
return xquik.parse_xquik_response(result), {}
raise RuntimeError(f"Unsupported source: {source}")