This commit is contained in:
@@ -134,7 +134,8 @@ By default, the command fetches from For You, News, Sports, and Entertainment ta
|
||||
import { TwitterClient } from '@yuta/bird';
|
||||
|
||||
const client = new TwitterClient({
|
||||
relayBaseUrl: process.env.TWITTER_RELAY_BASE_URL
|
||||
relayBaseUrl: process.env.TWITTER_RELAY_BASE_URL,
|
||||
profileName: process.env.BIRD_PROFILE_NAME
|
||||
});
|
||||
|
||||
// Search for tweets
|
||||
@@ -185,6 +186,7 @@ const sportsNews = await client.getNews(10, {
|
||||
|
||||
Global options:
|
||||
- `--relay-base-url <url>`: twitter safe relay base URL (defaults to `TWITTER_RELAY_BASE_URL`).
|
||||
- `--profile-name <name>`: twitter safe relay profile name (sent as `x-profile-name`).
|
||||
- `--timeout <ms>`: abort requests after the given timeout (milliseconds).
|
||||
- `--quote-depth <n>`: max quoted tweet depth in JSON output (default: 1; 0 disables).
|
||||
- `--plain`: stable output (no emoji, no color).
|
||||
@@ -203,6 +205,8 @@ Write operations:
|
||||
- If GraphQL returns error `226` (“automated request”), `bird` falls back to the legacy `statuses/update.json` endpoint.
|
||||
|
||||
Configure the relay URL with `TWITTER_RELAY_BASE_URL` or `--relay-base-url`.
|
||||
When your relay has multiple profiles, select one with `--profile-name`, `BIRD_PROFILE_NAME`, or `profileName`
|
||||
in config; bird forwards it as the `x-profile-name` header.
|
||||
|
||||
## Config (JSON5)
|
||||
|
||||
@@ -216,6 +220,7 @@ Example `~/.config/bird/config.json5`:
|
||||
```json5
|
||||
{
|
||||
relayBaseUrl: "http://localhost:6900",
|
||||
profileName: "main",
|
||||
timeoutMs: 20000,
|
||||
quoteDepth: 1
|
||||
}
|
||||
@@ -223,6 +228,7 @@ Example `~/.config/bird/config.json5`:
|
||||
|
||||
Environment shortcuts:
|
||||
- `TWITTER_RELAY_BASE_URL`
|
||||
- `BIRD_PROFILE_NAME`
|
||||
- `BIRD_TIMEOUT_MS`
|
||||
- `BIRD_QUOTE_DEPTH`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user