Skip to content

Commit

Permalink
update preg match & format code
Browse files Browse the repository at this point in the history
  • Loading branch information
copyrenzhe committed Jun 3, 2017
1 parent fe46468 commit 2ad1c1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Repositories/Snatch/Biquge.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ public function repair(Novel $novel, $force)
$start = $i * $this->page_size;
Log::info("修复小说[{$novel->id}], 第[{$i}]次循环开始,从第[{$start}]条取[{$this->page_size}]条");
$splice_list = array_slice($url_list, $start, $this->page_size);
$contents = $this->multi_send_test(self::DOMAIN . $novel->source_link . $splice_list, $this->page_size, 'utf-8');
$sourceLink = $novel->source_link;
$repairUrl = array_map(function($v) use($sourceLink) {
$chapterInfo = explode('/', $v);
$chapterId = end($chapterInfo);
return self::DOMAIN . $sourceLink . $chapterId;
}, $splice_list);
$contents = $this->multi_send_test($repairUrl, $this->page_size, 'utf-8');
$temp = [];
foreach ($contents as $k => $html) {
preg_match('/addBookMark\((\d+),.*?\)/s', $html, $read_match);
Expand Down

0 comments on commit 2ad1c1c

Please sign in to comment.