Skip to content

Commit 309deef

Browse files
committed
Remove write, DM, and cookie marketing from public docs.
Keep public copy focused on API-key reads across README, skills, and guides.
1 parent cae784b commit 309deef

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ documents = result["x_search"]["documents"]
5050

5151
```python
5252
from haystack.utils import Secret
53-
from haystack_integrations.components.websearch.x_api_scraper import (
54-
TwexApiUserTweetsFetcher,
55-
)
53+
from haystack_integrations.components.websearch.x_api_scraper import TwexApiUserTweetsFetcher
5654

5755
fetcher = TwexApiUserTweetsFetcher(api_key=Secret.from_env_var("X_API_SCRAPER_KEY"))
5856

examples/search_pipeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from haystack import Pipeline
22
from haystack.utils import Secret
3-
43
from haystack_integrations.components.websearch.x_api_scraper import TwexApiTweetSearch
54

65
search = TwexApiTweetSearch(api_key=Secret.from_env_var("X_API_SCRAPER_KEY"), top_k=10)

tests/test_client.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,15 @@
1919
def test_client_defaults() -> None:
2020
client = TwexApiClient("secret-key")
2121
assert client.base_url == DEFAULT_BASE_URL
22-
assert f"x-api-scraper-haystack/{__version__}" == USER_AGENT
22+
assert USER_AGENT == f"x-api-scraper-haystack/{__version__}"
2323
assert client.headers["Authorization"] == "Bearer secret-key"
2424

2525

2626
@pytest.mark.parametrize(
2727
("api_key", "kwargs", "error"),
2828
[
2929
(" ", {}, "api_key is empty"),
30-
(
31-
"secret-key",
32-
{"timeout_seconds": 0},
33-
"timeout_seconds must be greater than 0",
34-
),
30+
("secret-key", {"timeout_seconds": 0}, "timeout_seconds must be greater than 0"),
3531
(
3632
"secret-key",
3733
{"base_url": "twexapi.test"},
@@ -115,9 +111,7 @@ def handler(request: httpx.Request) -> httpx.Response:
115111
def test_http_and_json_errors() -> None:
116112
with httpx.Client(
117113
base_url="https://api.twexapi.test",
118-
transport=httpx.MockTransport(
119-
lambda request: httpx.Response(401, text="denied")
120-
),
114+
transport=httpx.MockTransport(lambda request: httpx.Response(401, text="denied")),
121115
) as http_client:
122116
client = TwexApiClient("secret-key", http_client=http_client)
123117
with pytest.raises(TwexApiError, match="HTTP 401") as exc:
@@ -137,9 +131,7 @@ def test_http_and_json_errors() -> None:
137131

138132
with httpx.Client(
139133
base_url="https://api.twexapi.test",
140-
transport=httpx.MockTransport(
141-
lambda request: httpx.Response(200, json=["nope"])
142-
),
134+
transport=httpx.MockTransport(lambda request: httpx.Response(200, json=["nope"])),
143135
) as http_client:
144136
client = TwexApiClient("secret-key", http_client=http_client)
145137
with pytest.raises(TwexApiError, match="unexpected JSON"):

0 commit comments

Comments
 (0)