fix(skills): document xurl X Article ingestion
This commit is contained in:
@ -192,6 +192,15 @@ xurl search "from:elonmusk" -n 20
|
|||||||
xurl search "#buildinpublic lang:en" -n 15
|
xurl search "#buildinpublic lang:en" -n 15
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For X Articles, use raw API mode instead of the `read` shortcut. `xurl read`
|
||||||
|
expects a post ID or post URL; do not put `read` before a `/2/tweets/...`
|
||||||
|
endpoint. Request the `article` tweet field and ingest `data.article.plain_text`
|
||||||
|
from the JSON response:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
xurl --app APP_NAME '/2/tweets/2057909493250539891?expansions=author_id,attachments.media_keys,referenced_tweets.id&tweet.fields=created_at,lang,public_metrics,context_annotations,entities,possibly_sensitive,conversation_id,in_reply_to_user_id,referenced_tweets,article'
|
||||||
|
```
|
||||||
|
|
||||||
### Users, Timeline, Mentions
|
### Users, Timeline, Mentions
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
29
tests/skills/test_xurl_article_ingestion_docs.py
Normal file
29
tests/skills/test_xurl_article_ingestion_docs.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
SKILL_MD = REPO_ROOT / "skills" / "social-media" / "xurl" / "SKILL.md"
|
||||||
|
DOC_MD = (
|
||||||
|
REPO_ROOT
|
||||||
|
/ "website"
|
||||||
|
/ "docs"
|
||||||
|
/ "user-guide"
|
||||||
|
/ "skills"
|
||||||
|
/ "bundled"
|
||||||
|
/ "social-media"
|
||||||
|
/ "social-media-xurl.md"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_xurl_article_ingestion_uses_raw_api_mode():
|
||||||
|
skill_text = SKILL_MD.read_text(encoding="utf-8")
|
||||||
|
docs_text = DOC_MD.read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
for text in (skill_text, docs_text):
|
||||||
|
assert "For X Articles, use raw API mode" in text
|
||||||
|
assert "`xurl read`" in text
|
||||||
|
assert "do not put `read` before a `/2/tweets/...`" in text
|
||||||
|
assert "tweet.fields=created_at,lang,public_metrics" in text
|
||||||
|
assert "referenced_tweets,article" in text
|
||||||
|
assert "data.article.plain_text" in text
|
||||||
|
assert "read '/2/tweets/" not in text
|
||||||
@ -206,6 +206,15 @@ xurl search "from:elonmusk" -n 20
|
|||||||
xurl search "#buildinpublic lang:en" -n 15
|
xurl search "#buildinpublic lang:en" -n 15
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For X Articles, use raw API mode instead of the `read` shortcut. `xurl read`
|
||||||
|
expects a post ID or post URL; do not put `read` before a `/2/tweets/...`
|
||||||
|
endpoint. Request the `article` tweet field and ingest `data.article.plain_text`
|
||||||
|
from the JSON response:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
xurl --app APP_NAME '/2/tweets/2057909493250539891?expansions=author_id,attachments.media_keys,referenced_tweets.id&tweet.fields=created_at,lang,public_metrics,context_annotations,entities,possibly_sensitive,conversation_id,in_reply_to_user_id,referenced_tweets,article'
|
||||||
|
```
|
||||||
|
|
||||||
### Users, Timeline, Mentions
|
### Users, Timeline, Mentions
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user