This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(douyin): ✨ 获取粉丝列表 * feat(douyin): ✨ 获取视频列表
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Waset\Douyin; | ||
|
||
class Fans extends Application | ||
{ | ||
/** | ||
* 获取粉丝列表 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $cursor | ||
* @param integer $count | ||
* @return Fans | ||
*/ | ||
public function list(string $access_token, string $openid, int $cursor = 0, int $count = 20) | ||
{ | ||
$api_url = self::BaseUrl . '/fans/list/'; | ||
|
||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"cursor" => $cursor, | ||
"count" => $count | ||
]; | ||
|
||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace Waset\Douyin; | ||
|
||
class Video extends Application | ||
{ | ||
/** | ||
* 获取粉丝列表 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $cursor | ||
* @param integer $count | ||
* @return Video | ||
*/ | ||
public function list(string $access_token, string $openid, int $cursor = 0, int $count = 20) | ||
{ | ||
$api_url = self::BaseUrl . '/video/list/'; | ||
|
||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"cursor" => $cursor, | ||
"count" => $count | ||
]; | ||
|
||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
} |