-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded SDK V1.11.8 Add Support V5.1.8 Twitter API
- Loading branch information
Showing
8 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 导入API SDK Client类 | ||
import json | ||
|
||
from tikhub.http_client.api_client import APIClient | ||
|
||
|
||
class TwitterWeb: | ||
|
||
# 初始化 | Initialize | ||
def __init__(self, client: APIClient): | ||
self.client = client | ||
|
||
# Fetch tweet detail | 获取推文详情 | ||
async def fetch_tweet_detail(self, focalTweetId: str): | ||
endpoint = "/api/v1/twitter/web/fetch_tweet_detail" | ||
data = await self.client.fetch_get_json(f"{endpoint}?focalTweetId={focalTweetId}") | ||
return data | ||
|
||
# Fetch user profile | 获取用户资料 | ||
async def fetch_user_profile(self, screen_name: str): | ||
endpoint = "/api/v1/twitter/web/fetch_user_profile" | ||
data = await self.client.fetch_get_json(f"{endpoint}?screen_name={screen_name}") | ||
return data | ||
|
||
# Fetch user post tweet | 获取用户发帖 | ||
async def fetch_user_post_tweet(self, userId: str, count: int = 20, cursor: str = None): | ||
endpoint = "/api/v1/twitter/web/fetch_user_post_tweet" | ||
data = await self.client.fetch_get_json(f"{endpoint}?userId={userId}&count={count}&cursor={cursor}") | ||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# tikhub/version.py | ||
version = "1.11.8" | ||
version = "1.11.9" |