-
Notifications
You must be signed in to change notification settings - Fork 0
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
VAGH
committed
Feb 24, 2020
1 parent
965bcf0
commit 9341906
Showing
209 changed files
with
32,944 additions
and
2 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/vender | ||
/vendor | ||
.idea |
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 |
---|---|---|
|
@@ -6,11 +6,14 @@ | |
use AlibabaCloud\Client\Exception\ServerException; | ||
use GuzzleHttp\Client; | ||
|
||
// 初始化阿里云 SDK 实例 | ||
// 参数分别是你阿里云的 accessKeyId 和 accessKeySecret | ||
AlibabaCloud::accessKeyClient('**********', '**********') | ||
->regionId('cn-hangzhou') | ||
->asDefaultClient(); | ||
|
||
try { | ||
// 你对小可爱的昵称 有多少就列多少 | ||
$name_arr = [ | ||
'小彭彭', | ||
'小傻瓜', | ||
|
@@ -25,6 +28,7 @@ | |
'搞黄彭', | ||
]; | ||
|
||
// 随机取一个昵称 | ||
$name_str = $name_arr[array_rand($name_arr)]; | ||
// format lucky number between 0~9 | ||
$number_str = rand(0,9); | ||
|
@@ -48,7 +52,9 @@ | |
->options([ | ||
'query' => [ | ||
'RegionId' => "cn-hangzhou", | ||
// 以下短信模板请自己申请 | ||
'PhoneNumbers' => "17627828449", | ||
// 签名也需要申请 | ||
'SignName' => "余大能耐", | ||
'TemplateCode' => "SMS_176539584", | ||
'TemplateParam' => json_encode($sms_content), | ||
|
@@ -62,7 +68,12 @@ | |
echo $e->getErrorMessage() . PHP_EOL; | ||
} | ||
|
||
|
||
/** | ||
* 获取天气信息 | ||
* @return string | ||
* @author yuzhihao <[email protected]> | ||
* @since 2020/2/24 | ||
*/ | ||
function getWeather() | ||
{ | ||
$location = "Beijing"; | ||
|
@@ -86,6 +97,12 @@ function getWeather() | |
return $str; | ||
} | ||
|
||
/** | ||
* 获取当前温度信息 | ||
* @return string | ||
* @author yuzhihao <[email protected]> | ||
* @since 2020/2/24 | ||
*/ | ||
function getAirNow() | ||
{ | ||
$location = "Beijing"; | ||
|
@@ -134,12 +151,25 @@ function getAirNow() | |
return $mess; | ||
} | ||
|
||
/** | ||
* 计算在一起多长时间 | ||
* @return false|float|int | ||
* @author yuzhihao <[email protected]> | ||
* @since 2020/2/24 | ||
*/ | ||
function getDays() | ||
{ | ||
// 在一起的时间 | ||
$d1 = strtotime("2019-10-30 00:00:00"); | ||
return ceil((time()-$d1)/60/60/24) - 1; | ||
} | ||
|
||
/** | ||
* 获取自己的昵称 | ||
* @return string | ||
* @author yuzhihao <[email protected]> | ||
* @since 2020/2/24 | ||
*/ | ||
function getFromName() | ||
{ | ||
$day = getDays(); | ||
|
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 @@ | ||
{ | ||
"name": "adbario/php-dot-notation", | ||
"description": "PHP dot notation access to arrays", | ||
"keywords": ["dotnotation", "arrayaccess"], | ||
"homepage": "https://github.com/adbario/php-dot-notation", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Riku Särkinen", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^4.0|^5.0|^6.0", | ||
"squizlabs/php_codesniffer": "^3.0" | ||
}, | ||
"autoload": { | ||
"files": [ | ||
"src/helpers.php" | ||
], | ||
"psr-4": { | ||
"Adbar\\": "src" | ||
} | ||
} | ||
} |
Oops, something went wrong.