Changeset 3127334
- Timestamp:
- 07/29/2024 12:07:06 PM (19 months ago)
- Location:
- keydatas/trunk
- Files:
-
- 3 edited
-
keydatas.php (modified) (8 diffs)
-
publish-setting.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
keydatas/trunk/keydatas.php
r2969579 r3127334 3 3 Plugin Name: 简数采集平台 4 4 Plugin URI: http://www.keydatas.com/caiji/wordpress-cms-caiji 5 Description: 简数采集器(keydatas.com)是一个通用、简单、智能、在线的网页数据采集器,功能强大,操作简单。支持按关键词采集;集成 翻译等服务;图片下载支持存储到阿里云OSS、七牛对象存储、腾讯云对象存储等。6 Version: 2. 5.25 Description: 简数采集器(keydatas.com)是一个通用、简单、智能、在线的网页数据采集器,功能强大,操作简单。支持按关键词采集;集成AI大模型接口、翻译等服务;图片下载支持存储到阿里云OSS、七牛、腾讯云对象存储等。 6 Version: 2.6.1 7 7 Author: keydatas 8 8 Author URI: http://www.keydatas.com … … 19 19 20 20 function keydatas_rsp($result = 1,$code = 0, $data = "", $msg = "") { 21 die( json_encode(array("rs" => $result, "code" => $code, "data" => $data, "msg" => urlencode($msg))));21 die(wp_json_encode(array("rs" => $result, "code" => $code, "data" => $data, "msg" => urlencode($msg)))); 22 22 } 23 23 function keydatas_genRandomIp(){ 24 $randIP = "". mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255);24 $randIP = "".wp_rand(0,255).".".wp_rand(0,255).".".wp_rand(0,255).".".wp_rand(0,255); 25 25 return $randIP; 26 26 } … … 40 40 */ 41 41 function keydatas_randFloat($min=0, $max=1){ 42 return $min + mt_rand()/mt_getrandmax() * ($max-$min);42 return $min + wp_rand()/mt_getrandmax() * ($max-$min); 43 43 } 44 44 … … 69 69 if (!empty($kds_flag)){ 70 70 //$_REQ = keydatas_mergeRequest(); 71 $kds_password = get_option('keydatas_password', "keydatas.com"); 71 $kds_password = get_option('keydatas_password', ''); 72 if (empty($kds_password)) { 73 keydatas_failRsp(1403, "password empty", "提交的发布密码为空"); 74 } 72 75 $post_password = keydatas_getPostValSafe('kds_password'); 73 76 if (empty($post_password) || $post_password != $kds_password) { … … 373 376 374 377 function keydatas_downloadImages(){ 378 $allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'ico']; 375 379 try{ 376 380 $downloadFlag = keydatas_getPostValSafe("__kds_download_imgs_flag"); … … 382 386 $upload_dir = wp_upload_dir(); 383 387 foreach ($docImgs as $imgUrl) { 388 // 清理和验证URL 389 $imgUrl = filter_var($imgUrl, FILTER_SANITIZE_URL); 390 if (!filter_var($imgUrl, FILTER_VALIDATE_URL)) { 391 continue; // 跳过非法的URL 392 } 393 // 尝试获取图片扩展名 394 $parsedUrl = parse_url($imgUrl); 395 $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; 396 $extension = pathinfo($path, PATHINFO_EXTENSION); 397 398 // 检查扩展名是否在允许的图片格式中 399 if (!in_array(strtolower($extension), $allowedExtensions)) { 400 continue; // 跳过非图片格式的URL 401 } 384 402 $urlItemArr = explode('/',$imgUrl); 385 403 $itemLen=count($urlItemArr); … … 392 410 $file = $finalPath . '/' . $imgName; 393 411 if(!file_exists($file)){ 412 // 下载图片前,先检查HTTP响应头是否为图片 413 $headers = @get_headers($imgUrl, 1); 414 if (strpos($headers[0], '200 OK') !== false && strpos($headers['Content-Type'], 'image/') !== false) { 394 415 $doc_image_data = file_get_contents($imgUrl); 395 file_put_contents($file, $doc_image_data); 416 if ($doc_image_data !== false) { 417 file_put_contents($file, $doc_image_data); 418 } 419 } 396 420 } 397 421 } … … 406 430 } 407 431 408 409 432 ?> -
keydatas/trunk/publish-setting.php
r2968537 r3127334 29 29 </style> 30 30 <?php 31 32 function keydatas_genRandomPassword($length = 32) { 33 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; 34 $charactersLength = strlen($characters); 35 $randomString = ''; 36 for ($i = 0; $i < $length; $i++) { 37 $randomString .= $characters[wp_rand(0, $charactersLength - 1)]; 38 } 39 return $randomString; 40 } 31 41 /** 32 42 保存处理 33 43 */ 34 $keydatas_password= 'keydatas.com';44 $keydatas_password= keydatas_genRandomPassword();// 生成默认随机密码 35 45 $keydatas_title_unique=false; 36 46 $keydatas_tbk_link_enble=false; … … 57 67 $keydatas_tbk_link_enble = get_option('keydatas_tbk_link_enble', $keydatas_tbk_link_enble); 58 68 } 69 59 70 ?> 60 71 <div class="wrap"> … … 85 96 </tr> 86 97 <tr> 87 <td>插件密码 :</td>88 <td><input type="text" name="keydatas_password" class="config-input" value="<?php echo esc_textarea($keydatas_password); ?>" />( 请注意修改并保管好)98 <td>插件密码<font color="red">*</font>:</td> 99 <td><input type="text" name="keydatas_password" class="config-input" value="<?php echo esc_textarea($keydatas_password); ?>" />(重要:请注意修改并保存) 89 100 </td> 90 101 </tr> … … 126 137 <div class="feature">4.<strong>全自动化:定时采集+自动发送</strong>;</div> 127 138 <div class="feature">5.支持规则处理,包括:字段补充内容或关键词、关键词内链、简繁体转换、翻译、第三方API等;</div> 128 <div class="feature">6.支持关键词泛采集;</div> 129 <div class="feature">7.与WordPress系统无缝结合,数据可轻松发送到WordPress系统中。</div> 139 <div class="feature">6.<strong>支持对接多种AI大模型API</strong>,轻松进行内容生成创作。支持:百度文心一言、Kimi、豆包、通义千问、讯飞星火大模型等;</div> 140 <div class="feature">7.支持关键词泛采集;</div> 141 <div class="feature">8.与WordPress系统无缝结合,数据可轻松发送到WordPress系统中。</div> 130 142 </td> 131 143 </tr> -
keydatas/trunk/readme.txt
r2969579 r3127334 5 5 Author URI: http://www.keydatas.com 6 6 Plugin URI: http://www.keydatas.com/wordpress-plugin 7 Stable tag: 2. 5.27 Stable tag: 2.6.1 8 8 Requires at least: 4.1 9 Tested up to: 6. 3.19 Tested up to: 6.6.1 10 10 Requires PHP: 5.2.4 11 11 License: GPLv2 or later … … 23 23 4.定时自动采集更新;<br> 24 24 5.图片支持下载到(阿里云OSS、七牛对象存储、腾讯云COS、又拍云);<br> 25 6.相比其它采集器,简数采集器更加简单易用,功能同样强大,且没有繁杂的流程;<br> 26 7.其它相关:火车头、八爪鱼、后羿;<br> 27 8.realation: caiji,seo,mip,keyword,description,jianshu,weixin,wechat,robot,spider,jinritoutiao,taobaoke,aliyun,qiniu,tengxunyun,baidu,huochetou,houyicaiji,shenjian,CSDN,cnblogs,zhihu,jianshu,wenzhang,gongzhonghao,locoy,bazhuayu,shenjianshou,wpspider,WP-AutoPost(WP-AutoBlog),WP-Jpost,5118,QQWorld.<br> 28 9.SEO Plugin,huochetou,google XML sitemap,WP Baidu Map,baiduxzh,Sitemap,baidu-submit-link,AutoTags,Github.<br> 25 6.支持对接多种AI大模型API,轻松进行内容生成创作。支持:百度文心一言、Kimi、豆包、通义千问、5118、讯飞星火大模型等。 26 7.相比其它采集器,简数采集器更加简单易用,功能同样强大,且没有繁杂的流程;<br> 27 8.其它相关:火车头、八爪鱼、后羿;<br> 28 9.realation: caiji,seo,mip,keyword,description,jianshu,weixin,wechat,robot,spider,jinritoutiao,taobaoke,aliyun,qiniu,tengxunyun,baidu,huochetou,houyicaiji,shenjian,CSDN,cnblogs,zhihu,jianshu,wenzhang,gongzhonghao,locoy,bazhuayu,shenjianshou,wpspider,WP-AutoPost(WP-AutoBlog),WP-Jpost,5118,QQWorld.<br> 29 10.SEO Plugin,huochetou,google XML sitemap,WP Baidu Map,baiduxzh,Sitemap,baidu-submit-link,AutoTags,Github.<br> 29 30 autospider,fanyi,Translate,LightSNS,collect<br> 30 1 0.wordpress插件推荐:百度熊掌号,百度推送,WordPress HTTPS (SSL),wp encrypt,really simple ssl,WPJAM-Basic,wp-super-cache,WP Rocket,All-in-One SEO Pack,login LockDown,Comments Link Redirect,Add Post URL,BackWPup,DX-auto-publish,Link Manager,No Category Parents,Platinum SEO Pack,WP Keyword Link,Yet Another Related Posts Plugin,Fix image width,Role Manager,Search & Replace,WordPress Database Backup,WP-PostViews,WP PHP widget,Baidu Sitemap Generator,DB Cache Reloaded Fix + Hyper Cache,SEO Friendly Images,BackWPup,Simple URLs,Redirection.31 11.wordpress插件推荐:百度熊掌号,百度推送,WordPress HTTPS (SSL),wp encrypt,really simple ssl,WPJAM-Basic,wp-super-cache,WP Rocket,All-in-One SEO Pack,login LockDown,Comments Link Redirect,Add Post URL,BackWPup,DX-auto-publish,Link Manager,No Category Parents,Platinum SEO Pack,WP Keyword Link,Yet Another Related Posts Plugin,Fix image width,Role Manager,Search & Replace,WordPress Database Backup,WP-PostViews,WP PHP widget,Baidu Sitemap Generator,DB Cache Reloaded Fix + Hyper Cache,SEO Friendly Images,BackWPup,Simple URLs,Redirection. 31 32 32 33 == Installation == … … 38 39 39 40 == Changelog == 41 = 2.6.1 = 42 * 下载图片做类型的校验 40 43 = 2.5.1 = 41 44 * 兼容php 8
Note: See TracChangeset
for help on using the changeset viewer.