diff --git a/twitter_openapi_python/pyproject.toml b/twitter_openapi_python/pyproject.toml index c197ad5..87f7d16 100644 --- a/twitter_openapi_python/pyproject.toml +++ b/twitter_openapi_python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "twitter_openapi_python" -version = "0.0.37" +version = "0.0.40" description = "Twitter OpenAPI" authors = ["fa0311 "] license = "proprietary" # or "AGPL-3.0-only" @@ -14,6 +14,7 @@ include = ["twitter_openapi_python/py.typed"] python = "^3.7" pydantic = ">=2.6" urllib3 = ">= 2.1.0 < 3.0.0" +xclienttransaction = ">= 1.0.0 < 2.0.0" twitter-openapi-python-generated = "0.0.33" diff --git a/twitter_openapi_python/requirements.txt b/twitter_openapi_python/requirements.txt index 579bf2a..1a889a3 100644 Binary files a/twitter_openapi_python/requirements.txt and b/twitter_openapi_python/requirements.txt differ diff --git a/twitter_openapi_python/setup.py b/twitter_openapi_python/setup.py index 93da89c..950765c 100644 --- a/twitter_openapi_python/setup.py +++ b/twitter_openapi_python/setup.py @@ -5,9 +5,14 @@ from setuptools import find_packages, setup NAME = "twitter_openapi_python" -VERSION = "0.0.37" +VERSION = "0.0.40" PYTHON_REQUIRES = ">=3.7" -REQUIRES = ["twitter_openapi_python_generated == 0.0.33", "pydantic >= 2.6", "urllib3 >= 2.1.0, < 3.0.0"] +REQUIRES = [ + "twitter_openapi_python_generated == 0.0.33", + "pydantic >= 2.6", + "urllib3 >= 2.1.0, < 3.0.0", + "xclienttransaction >= 1.0.0, < 2.0.0" +] GITHUB_RAW_URL = ( "https://raw.githubusercontent.com/fa0311/twitter_openapi_python/refs/heads/master/twitter_openapi_python/" ) diff --git a/twitter_openapi_python/test/api/test_1_tweet_api.py b/twitter_openapi_python/test/api/test_1_tweet_api.py index 7d01349..a212a07 100644 --- a/twitter_openapi_python/test/api/test_1_tweet_api.py +++ b/twitter_openapi_python/test/api/test_1_tweet_api.py @@ -60,12 +60,12 @@ def test_get_bookmarks(self): print_tweet(tweet) def test_get_community_tweets_timeline(self): - result = self.client.get_community_tweets_timeline() + result = self.client.get_community_tweets_timeline(community_id="1489422448332197888") for tweet in list(filter(self.ad_fillter, result.data.data)): print_tweet(tweet) def test_get_community_media_timeline(self): - result = self.client.get_community_media_timeline() + result = self.client.get_community_media_timeline(community_id="1489422448332197888") for tweet in list(filter(self.ad_fillter, result.data.data)): print_tweet(tweet) diff --git a/twitter_openapi_python/twitter_openapi_python/api/tweet_api.py b/twitter_openapi_python/twitter_openapi_python/api/tweet_api.py index f37ec97..3bffc88 100644 --- a/twitter_openapi_python/twitter_openapi_python/api/tweet_api.py +++ b/twitter_openapi_python/twitter_openapi_python/api/tweet_api.py @@ -301,12 +301,13 @@ def get_bookmarks( def get_community_tweets_timeline( self, + community_id: str, cursor: Optional[str] = None, count: Optional[int] = None, rankingMode: Optional[Literal["Recency", "Relevance"]] = None, extra_param: Optional[ParamType] = None, ) -> ResponseType: - param: ParamType = {} + param: ParamType = {"communityId": community_id} if cursor is not None: param["cursor"] = cursor if count is not None: @@ -328,11 +329,12 @@ def get_community_tweets_timeline( def get_community_media_timeline( self, + community_id: str, cursor: Optional[str] = None, count: Optional[int] = None, extra_param: Optional[ParamType] = None, ) -> ResponseType: - param: ParamType = {} + param: ParamType = {"communityId": community_id} if cursor is not None: param["cursor"] = cursor if count is not None: