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.
- Loading branch information
Showing
1 changed file
with
138 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,138 @@ | ||
<?php | ||
|
||
namespace Waset\Douyin; | ||
|
||
class Data extends Application | ||
{ | ||
/** | ||
* 获取用户视频情况 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function item($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/item/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
|
||
/** | ||
* 获取用户粉丝数 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function fans($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/fans/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
|
||
/** | ||
* 获取用户点赞数 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function like($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/like/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
|
||
/** | ||
* 获取用户评论数 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function comment($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/comment/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
|
||
/** | ||
* 获取用户分享数 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function share($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/share/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
|
||
/** | ||
* 获取用户主页访问数 | ||
* | ||
* @param string $access_token | ||
* @param string $openid | ||
* @param integer $date_type | ||
* @return User | ||
*/ | ||
public function profile($access_token, $openid, $date_type = 30) | ||
{ | ||
$api_url = self::BaseUrl . '/data/external/user/profile/'; | ||
$headers = [ | ||
"access-token: ${access_token}", | ||
'Content-Type: application/json', | ||
]; | ||
$params = [ | ||
'open_id' => $openid, | ||
"date_type" => 30 | ||
]; | ||
return $this->https_get($api_url, $params, $headers); | ||
} | ||
} |