|
|
@ -44,10 +44,14 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
//上面验证通过,继续执行 |
|
|
|
//上面验证通过,继续执行 |
|
|
|
//取出tinypng key |
|
|
|
//取出tinypng key |
|
|
|
$kyes = $row['values']; |
|
|
|
//拼写错误处理 |
|
|
|
$kyes = json_decode($kyes); |
|
|
|
$keys = $row['values']; |
|
|
|
$i = 'api'.rand(1,2); |
|
|
|
|
|
|
|
$key = $kyes->$i; |
|
|
|
//可以使用任意多个key |
|
|
|
|
|
|
|
//@todo 建议使用列表类型而不是联名数组类型保存key |
|
|
|
|
|
|
|
$keys = json_decode($keys, true); |
|
|
|
|
|
|
|
$i = 'api'.rand(1, count($keys)); |
|
|
|
|
|
|
|
$key = $keys[$i-1]; |
|
|
|
|
|
|
|
|
|
|
|
$url = "https://api.tinify.com/shrink"; |
|
|
|
$url = "https://api.tinify.com/shrink"; |
|
|
|
$data = file_get_contents($path); |
|
|
|
$data = file_get_contents($path); |
|
|
|