Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
1. 添加超时
Browse files Browse the repository at this point in the history
2. 更新readme
  • Loading branch information
LittleJake committed Nov 2, 2020
1 parent f300c65 commit 17d82c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public static function getHitokoto()
curl_setopt($ch, CURLOPT_URL, $url.$category);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type:application/json'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$json = curl_exec($ch);
curl_close($ch);
Expand All @@ -169,6 +170,8 @@ public static function getHitokoto()
}

/**
* 用于处理、格式化json不同类型的数据
*
* @param $array
* @return string|string[]
* @throws Typecho_Exception
Expand Down

0 comments on commit 17d82c7

Please sign in to comment.