Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
}
},
"originGitCommit": "bbd2054c67ad246b017399f96faf58cf6737bf01",
"sdkVersion": "2.0.1"
"sdkVersion": "2.0.2"
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "newscatcher-sdk"
version = "2.0.1"
version = "2.0.2"
description = ""
readme = "README.md"
authors = []
Expand Down
12 changes: 5 additions & 7 deletions src/newscatcher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def get_all_headlines(
) # This creates "1d", "2h", etc.

# Make the first request
first_response = self.latest_headlines.latest_headlines_post(
first_response = self.latest_headlines.post(
when=when_param, page=1, **request_params
)

Expand Down Expand Up @@ -808,10 +808,8 @@ def get_all_headlines(
break

try:
page_response = (
self.latest_headlines.latest_headlines_post(
when=when_param, page=page, **request_params
)
page_response = self.latest_headlines.post(
when=when_param, page=page, **request_params
)

# Get articles safely from page response
Expand Down Expand Up @@ -1050,7 +1048,7 @@ async def get_all_headlines(
when_param = calculate_when_param(chunk_end, chunk_start)

# Make the first request
first_response = await self.latest_headlines.latest_headlines_post(
first_response = await self.latest_headlines.post(
when=when_param, page=1, **request_params
)

Expand Down Expand Up @@ -1090,7 +1088,7 @@ async def get_all_headlines(
async def fetch_page(page_num):
async with semaphore:
try:
return await self.latest_headlines.latest_headlines_post(
return await self.latest_headlines.post(
when=when_param, page=page_num, **request_params
)
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions src/newscatcher/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "newscatcher-sdk/2.0.1",
"User-Agent": "newscatcher-sdk/2.0.2",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "newscatcher-sdk",
"X-Fern-SDK-Version": "2.0.1",
"X-Fern-SDK-Version": "2.0.2",
**(self.get_custom_headers() or {}),
}
headers["x-api-token"] = self.api_key
Expand Down
Loading