Changeset 2375013
- Timestamp:
- 09/04/2020 08:07:19 AM (6 years ago)
- Location:
- beepress/trunk
- Files:
-
- 3 edited
-
beebox/includes/Utils/CrawlerCore.php (modified) (4 diffs)
-
beepress.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
beepress/trunk/beebox/includes/Utils/CrawlerCore.php
r2367529 r2375013 199 199 // TODO: keep the right order 200 200 // get images 201 // get feature image 202 // $images 203 204 $rule = $this->rule; 205 $imageRules = $rule['target']['img']; 206 $featureImgRule = $imageRules['feature_img']; 207 $featureImgMatches = $this->getMatch($response, $featureImgRule, true); 208 209 201 210 $content = $this->getRealContent($response); 202 211 203 212 $images = $this->getImages($content); 213 214 215 // $featureImgSrcArr = array(); 216 // switch($featureImgRule['type']) { 217 // case 1: 218 // $featureImgSrcArr[] = $featureImgMatches; 219 // break; 220 // case 2: 221 // foreach($featureImgMatches as $match) { 222 // $src = $match->getAttribute($featureImgRule['src']); 223 // // process the image src 224 225 // // get the scheme of post link 226 // $scheme = parse_url($this->targetUrl, PHP_URL_SCHEME); 227 // if (stristr($src, 'http://') || stristr($src, 'https://')) { 228 229 // } else { 230 // $src = str_replace(array('//'), array($scheme . '://'), $src); 231 // } 232 233 // if ($src) { 234 // $featureImgSrcArr[] = $src; 235 // } 236 // } 237 // break; 238 // } 239 240 $images['feature_img'] = $featureImgMatches; 204 241 // get real content 205 242 … … 365 402 $rule = $this->rule; 366 403 $imageRules = $rule['target']['img']; 367 $featureImgRule = $imageRules['feature_img'];368 $featureImgMatches = $this->getMatch($content, $featureImgRule, true);404 // $featureImgRule = $imageRules['feature_img']; 405 // $featureImgMatches = $this->getMatch($content, $featureImgRule, true); 369 406 $innerImgMatches = $this->getMatch($content, $imageRules['inner_img'], true); 370 407 $backgroundImgMatches = $this->getMatch($content, $imageRules['background_img'], true); 371 408 372 $featureImgSrcArr = array(); 373 switch($featureImgRule['type']) { 374 case 1: 375 // $featureImgSrcArr[] = $featureImgMatches; 376 break; 377 case 2: 378 foreach($featureImgMatches as $match) { 379 $src = $match->getAttribute($featureImgRule['src']); 380 // process the image src 381 382 // get the scheme of post link 383 $scheme = parse_url($this->targetUrl, PHP_URL_SCHEME); 384 if (stristr($src, 'http://') || stristr($src, 'https://')) { 385 386 } else { 387 $src = str_replace(array('//'), array($scheme . '://'), $src); 388 } 389 390 if ($src) { 391 $featureImgSrcArr[] = $src; 392 } 393 } 394 break; 395 } 409 396 410 $innerImgSrcArr = array(); 397 411 switch($imageRules['inner_img']['type']) { … … 438 452 } 439 453 $images = array( 440 'feature_img' => $featureImgMatches,441 454 'inner_img' => array_merge($innerImgSrcArr, $backgroundImgSrcArr) 442 455 ); … … 454 467 switch($rule['type']) { 455 468 case 1: 456 $isMatch = preg_match($rule['rule'], $content, $matches); 469 $isMatch = preg_match($rule['rule'], $content, $matches); 457 470 if ($isMatch) { 458 471 $match = $matches[1]; -
beepress/trunk/beepress.php
r2367529 r2375013 4 4 Plugin URI: http://xingyue.artizen.me?source=wp 5 5 Description: 蜜蜂采集(BeePress) 是一款能够帮助你导入微信公众号文章、知乎专栏文章、简书文章、今日头条文章的插件(支持规则配置采集其他网站文章),可以实现单篇或者批量导入、自动同步文章、采集指定公众号所有历史文章,支持将图片资源保存到本地,同时集成了强大的内容推荐功能。 6 Version: 6.8. 16 Version: 6.8.2 7 7 Author: Bee 8 8 Author URI: http://xingyue.artizen.me?source=wp … … 13 13 * 初始化 14 14 */ 15 define('BEEPRESS_VERSION', '6.8. 1');15 define('BEEPRESS_VERSION', '6.8.2'); 16 16 if(!class_exists('simple_html_dom_node')){ 17 17 require_once("simple_html_dom.php"); -
beepress/trunk/readme.txt
r2367529 r2375013 4 4 Author URI: http://xingyue.artizen.me?source=wp 5 5 Plugin URI: http://xingyue.artizen.me?source=wp 6 Stable tag: 6.8. 16 Stable tag: 6.8.2 7 7 Requires at least: 4.2 8 8 Requires PHP: 5.3.0 … … 58 58 None 59 59 == Changelog == 60 = 6.8.2 = 61 * 修复百宝箱特色图问题 60 62 = 6.8.1 = 61 63 * 修复采集问题
Note: See TracChangeset
for help on using the changeset viewer.