From d7bd0cffbef685b0bad311a2e85314d607feec90 Mon Sep 17 00:00:00 2001 From: shixuesen Date: Tue, 19 Feb 2019 11:42:37 +0800 Subject: [PATCH] add rename dir --- app/Services/XiuGirlsService.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/Services/XiuGirlsService.php b/app/Services/XiuGirlsService.php index 7a01345..bb06f02 100644 --- a/app/Services/XiuGirlsService.php +++ b/app/Services/XiuGirlsService.php @@ -15,7 +15,26 @@ class XiuGirlsService { $baseUrl = "http://www.xiugirls.com/girl/22162"; $albumSelector = ".entryAblum > .star-mod-bd > ul > li > a"; - $ql = QueryList::get($baseUrl)->find($albumSelector)->attrs("href"); + $baseQl = QueryList::get($baseUrl); + $ql = $baseQl->find($albumSelector)->attrs("href"); + + // new dir ---- + /** + $titles = $baseQl->find($albumSelector)->attrs("*"); +// print_r($titles->all());exit; + $baseDir = "/Users/shixuesen/Documents/xiugirl/"; + + foreach ($titles->all() as $item) { + if (file_exists($baseDir .explode("/", $item['href'])[2])) { + echo "old name :".$baseDir .explode("/", $item['href'])[2] . "\n"; + rename($baseDir.explode("/", $item['href'])[2], $baseDir.explode("/", $item['href'])[2] ."-".$item['title']); + } + } + exit; + */ + // new dir ---- + + $items = $ql->all(); $items = array_slice($items, 49); // print_r($items);exit;