Ai
2 Star 7 Fork 1

gmg137/UEditor-SCS-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
scs_crawler.php 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
gmg137 提交于 2014-09-06 15:07 +08:00 . Update README.md
<?php
/**
* 抓取远程图片
* User: gmg137
* Date: 14-09-05
* Time: 下午11:21
*/
set_time_limit(0);
include("scs_Uploader.class.php");
/* 上传配置 */
$config = array(
"pathFormat" => $CONFIG['catcherPathFormat'],
"maxSize" => $CONFIG['catcherMaxSize'],
"allowFiles" => $CONFIG['catcherAllowFiles'],
"oriName" => "remote.png"
);
$fieldName = $CONFIG['catcherFieldName'];
/* 抓取远程图片 */
$list = array();
if (isset($_POST[$fieldName])) {
$source = $_POST[$fieldName];
} else {
$source = $_GET[$fieldName];
}
foreach ($source as $imgUrl) {
$item = new Uploader($imgUrl, $config, "remote", $accessKey, $secretKey, $bucket);
$info = $item->getFileInfo();
array_push($list, array(
"state" => $info["state"],
"url" => $info["url"],
"size" => $info["size"],
"title" => htmlspecialchars($info["title"]),
"original" => htmlspecialchars($info["original"]),
"source" => htmlspecialchars($imgUrl)
));
}
/* 返回抓取数据 */
return json_encode(array(
'state'=> count($list) ? 'SUCCESS':'ERROR',
'list'=> $list
));
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/gmg137/UEditor-SCS-plugin.git
git@gitee.com:gmg137/UEditor-SCS-plugin.git
gmg137
UEditor-SCS-plugin
UEditor-SCS-plugin
master

搜索帮助