sqlGenerate();exit; // $this->test11();exit; // $this->test10();exit; // $this->test09();exit; // $this->test08();exit; // $this->test7();exit; // $this->test02(); // exit; // $this->test5();exit; // $this->test01();exit; $this->test04();exit; // echo strlen("[VLOG] 메이드와 단 둘이 청소하실래요-ㅣ메이드복 입고 청소하기__ㅣ모델 일상 코스프레 브이로그ㅣCleaning Maid Cosplayㅣメイドといっしょに掃除しませんか?");exit; // $service = new GooglePhotoSyncService(); // $service->syncDBToRedis();exit; // $service->insertMappings();exit; // $service->syncImageFiles(); // exit; // $baseDir = "/Users/shixuesen/Documents/sync/image"; $baseDir = "/Users/shixuesen/Documents/otherSync/very"; $baseDir = "/Users/shixuesen/Downloads/y"; $dirs = ["mv"]; $files = []; foreach ($dirs as $dir) { $currentFiles = scandir($baseDir . DIRECTORY_SEPARATOR . $dir); foreach ($currentFiles as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store" || is_dir($baseDir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $file)) { continue; } $files[] = $baseDir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $file; } // $files = array_merge($files, $currentFiles); } $md5Set = []; // $newDir = "/Users/shixuesen/Downloads/y/Nagisa魔物喵202003fantia会员合集/魔物喵__001"; // mkdir($newDir); $i = 0; foreach ($files as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store") { continue; } $hash = md5_file($file); if (array_key_exists($hash, $md5Set)) { echo "file is same $file, and {$md5Set[$hash]} \n"; // rename($dir . DIRECTORY_SEPARATOR . $file, $newDir . DIRECTORY_SEPARATOR . $file); // exit; $i++; } else { $md5Set[$hash] = $file; } } echo "all same file count is $i"; exit; // $pid = pcntl_fork(); $childs = array(); $cmds = array( array('/Users/shixuesen/Downloads/temp/dir1/1.txt', '/Users/shixuesen/Downloads/temp/dir2/1.txt'), array('/Users/shixuesen/Downloads/temp/dir1/1.txt', '/Users/shixuesen/Downloads/temp/dir3/1.txt'), array('/Users/shixuesen/Downloads/temp/dir1/1.txt', '/Users/shixuesen/Downloads/temp/dir4/1.txt'), ); echo 'begin'; echo date("Y-m-d H:i:s"); foreach ($cmds as $cmd) { $pid = pcntl_fork(); if ($pid == -1) { // process creation failed die('fork child process failure!'); } else if ($pid) { // parent process logic $childs[] = $pid; pcntl_wait($status, WNOHANG); } else { // sub-process processing logic pcntl_exec('/bin/cp', $cmd); } } while (count($childs) > 0) { foreach ($childs as $key => $pid) { $res = pcntl_waitpid($pid, $status, WNOHANG); //1 for error, greater than 0 representative process has been withdrawn, returns to the pid of the sub-process, and 0 representatives have not been able to take the exit sub-process when it is not blocked if ($res == -1 || $res > 0) { unset($childs[$key]); } } sleep(1); } echo "start sleep"; sleep(100); echo date("Y-m-d H:i:s"); echo 'done'; exit; echo time() . "\n"; $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { // we are the parent pcntl_wait($status); //Protect against Zombie children } else { // we are the child pcntl_exec("/bin/cp", ["/Users/shixuesen/Downloads/temp/dir1/1.txt", "/Users/shixuesen/Downloads/temp/dir2/1.txt"]); } pcntl_exec("/bin/cp", ["/Users/shixuesen/Downloads/temp/dir1/1.txt", "/Users/shixuesen/Downloads/temp/dir3/1.txt"]); pcntl_exec("/bin/cp", ["/Users/shixuesen/Downloads/temp/dir1/1.txt", "/Users/shixuesen/Downloads/temp/dir4/1.txt"]); echo time(); exit; $service = new GooglePhotoSyncService(); // $service->syncDBToRedis();exit; // $service->insertMappings();exit; $service->syncImageFiles(); exit; // $service = new FileService(); // $service->queryFileTime("/Users/shixuesen/Documents/sync/image/instagram/mobe_carrie0223/mobe__0020/82339160_561812341080795_8865402232426240219_n.jpg");exit; // echo $service->processDirAndFindLastFileMTime("/Users/shixuesen/Documents/sync/image/weibo/");exit; // $service = new LiveStreamService(); // $service->moveFilesAndRenameFiles("/Users/shixuesen/Downloads/rsyncFiles/a", "/Users/shixuesen/Downloads/rsyncFiles/b"); // exit; // $a = str_replace("/", "", "aaaaa/bbbb"); // echo $a;exit; // $file = "/Volumes/Crucial X6/Image/weibo/image/一只小短短OwO--7f605a17gy1gxpb0pg31vj22eo37k1kz.jpg"; $file = "/Users/shixuesen/Documents/sync/image/instagram/Likes/eeelyeee_277962893_719835709026094_2370282265319075961_n.jpg"; // $file = "/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/eeelyeee_277962893_719835709026094_2370282265319075961_n.jpg"; $file = "/Users/shixuesen/Documents/sync/image/instagram/boram__jj/277958530_1581189285586989_5049761303029075957_n.jpg"; // $file = "/Users/shixuesen/OneDrive/Pictures/instagram/boram__jj/277958530_1581189285586989_5049761303029075957_n.jpg"; $mtime = date("Y-m-d H:i:s", filemtime($file)); $atime = date("Y-m-d H:i:s", fileatime($file)); $ctime = date("Y-m-d H:i:s", filectime($file)); // $stat = stat($file); echo "file mtime is $mtime, atime is $atime, ctime is $ctime"; // dump($stat); } public function test01() { $keys = Redis::connection("cache_txy4")->lrange("file_to_encode", 0, -1); foreach ($keys as $key) { if (str_contains($key, "崔兔子")) { // echo $key; Redis::connection("cache_txy4")->lrem("file_to_encode", 0, $key); } } // dump($keys); // echo Redis::connection("cache_txy4")->get("aaaaaa");exit; } public function test02() { $url = "https://wx4.sinaimg.cn/large/a2ca2fd3ly1hdcbwq251wj20h70fi0zi.jpg"; $urlInfo = parse_url($url); $host = $urlInfo["host"]; $client = new Client(); $headers = [ 'authority' => $host, 'accept' => 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8', 'accept-language' => 'zh-CN,zh;q=0.9', 'cache-control' => 'no-cache', 'pragma' => 'no-cache', 'referer' => 'https://m.weibo.cn/', 'sec-ch-ua' => '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"', 'sec-ch-ua-mobile' => '?0', 'sec-ch-ua-platform' => '"macOS"', 'sec-fetch-dest' => 'image', 'sec-fetch-mode' => 'no-cors', 'sec-fetch-site' => 'cross-site', 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', ]; $request = new Request('GET', $url, $headers); $res = $client->sendAsync($request)->wait(); return $res->getBody(); } public function test03() { $list = Redis::connection()->smembers("永远别问为什么"); $files = scandir("/Volumes/Xcode"); foreach ($files as $file) { if ($file == "." || $file == "..") { continue; } if (!in_array($file, $list)) { echo "$file not in array \n"; } } } /** * 相同文件查找 * @return void */ public function test04() { // $baseDir = "/Volumes/Xcode/"; // $baseDir = "/Volumes/Crucial X6/就是阿朱啊/就是阿朱啊-5"; // $dirs = ["阿朱_2010"]; $baseDir = "/Users/shixuesen/Documents/otherSync/very/"; $dirs = ["QQ_Pic6"]; // $f1 = "._{CCE5795D-9D78-5CF9-64C4-F170BD9A943E}(1).jpg"; // echo starts_with($f1, "._");exit; // $baseDir = "/Volumes/T7/"; // $dirs = ["mv"]; $files = []; foreach ($dirs as $dir) { $currentFiles = scandir($baseDir . DIRECTORY_SEPARATOR . $dir); foreach ($currentFiles as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store" || is_dir($baseDir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $file || starts_with($file, "._"))) { continue; } $starts_with_result = starts_with($file, "._"); if ($starts_with_result) { // echo "file is $file and starts_with is $starts_with_result \n"; continue; } $files[] = $baseDir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $file; } // $files = array_merge($files, $currentFiles); } $md5Set = []; // $newDir = "/Users/shixuesen/Downloads/y/Nagisa魔物喵202003fantia会员合集/魔物喵__001"; // mkdir($newDir); $i = 0; foreach ($files as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store" || starts_with($file, "._")) { continue; } $hash = sha1_file($file); if (array_key_exists($hash, $md5Set)) { echo "file is same $file, and {$md5Set[$hash]} \n"; // rename($dir . DIRECTORY_SEPARATOR . $file, $newDir . DIRECTORY_SEPARATOR . $file); // exit; $i++; } else { $md5Set[$hash] = $file; } } echo "all same file count is $i"; exit; } /** * 针对百度网盘下载的 * 根据秀人相册的模特名字以 500 个文件作为一个文件夹重新整理 * @return void */ public function test5() { $dir = "/Volumes/T7/Image/xiuren/6151-6200/6151-6200.7z/"; // $dir = "/Users/shixuesen/Documents/otherSync/xiuren/"; $files = scandir($dir); $set = []; $toMoveFiles = []; foreach ($files as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store") { continue; } preg_match("#NO.\d+\s(\S+)\[#", $file, $matches); $owner_name = $matches[1]; $subDir = implode(DIRECTORY_SEPARATOR, [$dir, $file]); if (is_dir($subDir)) { $imageFiles = array_diff(scandir($subDir), [".", "..", ".DS_Store"]); foreach ($imageFiles as $imageFile) { $toMoveFiles[$owner_name][] = implode(DIRECTORY_SEPARATOR, [$subDir, $imageFile]); } } // if (array_key_exists($owner_name, $set)) { // $set[$owner_name] ++; // dump("$owner_name exists"); // } else { // $set[$owner_name] = 1; // } // dump($owner_name); } foreach ($toMoveFiles as $owner => $toMoveFile) { dump(count($toMoveFile)); $totalNum = count($toMoveFile); $n = floor($totalNum / 500); for ($i = 0; $i < $totalNum; $i++) { $trueDir = $dir . DIRECTORY_SEPARATOR . $owner . "_00" . floor($i / 500); if ($i % 500 == 0 && !is_dir($trueDir)) { mkdir($trueDir); } $newFile = $trueDir . DIRECTORY_SEPARATOR . pathinfo($toMoveFile[$i])["basename"]; dump("new file is " . $newFile); rename($toMoveFile[$i], $trueDir . DIRECTORY_SEPARATOR . pathinfo($toMoveFile[$i])["basename"]); } } exit; // dump($toMoveFiles); // $allV = 0; // foreach ($set as $k => $v) { // $allV += $v; // } // dump($set); // dump($allV); } public function test06() { $arr = ["(PRESTIGE)(IDBD-505)甘い誘惑 ハニートラップで男を誘うオンナ達 希崎ジェシカ 天海つばさ 冬月かえで 希志あいの Rio 等_2.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_5.mp4", "[Thz.la]ipz-814.mp4", "(IDEAPOCKET)(IPZ-440)刺激的なTバックの淫らな誘惑 天海つばさ.mp4", "【更多福利www.51fuliku.com-福利库】ARKX025.mp4", "(IdeaPocket)OL痴漢電車 - 天海つばさ A.mp4", "[Thz.la]sspd-133.mp4", "[NoDRM]-iptd00982hhb2.mp4", "(IDEAPOCKET)(IPZ-893)特ダネSCOOP!天海つばさ持ち込みプライベートSEX セルフ撮影映像.mp4", "[NoDRM]-ipz00157hhb3.mp4", "(IDEAPOCKET)(IPZ-456)ハメられた新人美女RQ 断り切れず枕営業を虐げられる美裸体 天海つばさ.mp4", "(IDEAPOCKET)(IPZ-692)『まだ未開の快感が欲しくて…』催眠 トランス バースト寸前!超絶オーガズムSEX 天海つばさ.mp4", "[44x.me]oae-161.mp4", "[NoDRM]-iptd00533hhb4.mp4", "[NoDRM]-ipz00080hhb2.mp4", "(IDEAPOCKET)(IPZ-862)リピーター続出!噂の本番できちゃうおっパブ店 天海つばさ.mp4", "(IDEAPOCKET)(IPZ-587)無理矢理AVに出演させられた美人マネージャー 天海つばさ.mp4", "[Thz.la]ipx-081.mp4", "[NoDRM]-iptd00533hhb2.mp4", "[44x.me]idbd-789-2.mp4", "[NoDRM]-iptd00521hhb1.mp4", "[NoDRM]-iptd00982hhb1.mp4", "[NoDRM]-ipz00135hhb1.mp4", "[FHD]IPZ-692.mp4", "[NoDRM]-ipz00119hhb3.mp4", "[44x.me]ipx-239.mp4", "[456k.me]ipz-739.mp4", "(Ideapocket)(IDBD-403)321イク~!発射間際からチュパチュパレロレロのフェラで大発射!かすみ果穂 竹内紗里奈 等_1.mp4", "[NoDRM]-ipz00041hhb3.mp4", "(IDEAPOCKET)(IPZ-831)オフ会セックスパーティー!デビュー7周年記念!連続発売第一弾!「天海つばさ」セルフプロデュース作品.mp4", "[FHD]IPZ-801.mp4", "(IDEAPOCKET)(IPZ-371)うちの妻を犯して下さい 天海つばさ.mp4", "【更多福利www.51fuliku.com-福利库】IDBD278-02.mp4", "[NoDRM]-ipz00119hhb2.mp4", "[NoDRM]-iptd00916hhb2.mp4", "(IDEAPOCKET)(IPZ-530)セックスボランティア 天海つばさ.mp4", "[456k.me]idbd-699-2.mp4", "[NoDRM]-iptd00521hhb4.mp4", "(IDEAPOCKET)(IPZ-548)エスコートSEX 甘いヴァーチャル痴女の誘い240分 天海つばさ.mp4", "[44x.me]idbd-789.mp4", "(死夜悪)(SHKD-739)服従の事件簿 File.001 天海つばさ.mp4", "[Idea Pocket][idbd-278] 天海つばさのフェラチオ360分SP (Tsubasa Amami) A.mp4", "(龍縛)(RBD-830)奴隷色のステージ36 天海つばさ.mp4", "(IDEAPOCKET)(IPX-031)サディスティックな変態性交に濡れ溺れて…性覚醒!浴尿!放尿!痛快感!汚アナル愛撫!浮気性交!天海つばさ.mp4", "[thz.la]IPZ-563.1080p.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_4.mp4", "[NoDRM]-ipz00041hhb1.mp4", "(死夜悪)(SHKD-723)脱獄者 天海つばさ.mp4", "[456k.me]idbd-764-2.mp4", "(IDEAPOCKET)(IPZ-959)解禁!人生初 生中出しセックス 本物ザーメンを膣中に暴射!天海つばさ.mp4", "[456k.me]idbd-764.mp4", "[NoDRM]-ipz00058hhb3.mp4", "(IdeaPocket)HIP ATTACK - 天海つばさ C.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_2.mp4", "[NoDRM]-ipz00157hhb1.mp4", "[NoDRM]-ipz00058hhb4.mp4", "[NoDRM]-ipz00058hhb2.mp4", "(Ideapocket)(IPTD-706)むっちゃ好きやねん 感じてあふれる方言SEX 天海つばさ.mp4", "【更多福利www.51fuliku.com-福利库】IPTD533(1).mp4", "(IDEAPOCKET)(IPZ-641)流出した下着モデルのSEXテープ…【全編盗撮 ハメ撮り撮影】天海つばさ.mp4", "(IDEAPOCKET)(IPZ-472)連続射精してしまうほど過激な性交 天海つばさ.mp4", "(IdeaPocket)HIP ATTACK - 天海つばさ B.mp4", "(IDEAPOCKET)(IPZ-978)緊縛調教に目覚めたマゾ極妻~麗しき君の縄~天海つばさ.mp4", "(IdeaPocket)HIP ATTACK - 天海つばさ A.mp4", "[bbs.yzkof.com]IDBD-610 B[约战竞技场].mp4", "(龍縛)(RBD-821)快楽拷問研究所5 天海つばさ.mp4", "[NoDRM]-iptd00982hhb3.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_1.mp4", "[NoDRM]-ipz00080hhb1.mp4", "【更多福利www.51fuliku.com-福利库】IDBD278-03.mp4", "(IDEAPOCKET)(AVOP-301)LEGEND IMPRESSION 史上最強コンテンツで贈る奇跡の共演!240分 希崎ジェシカ 天海つばさ.mp4", "(IDEAPOCKET)(IPZ-945)突撃!単体女優天海つばさが噂の風俗店に体当たりガチ潜入リポート ピンサロから出張ホスト、オナニーCLUB.mp4", "[NoDRM]-ipz00119hhb1.mp4", "(龍縛)(RBD-807)マゾに目覚めた女3 天海つばさ 羽田璃子.mp4", "[NoDRM]-ipz00080hhb3.mp4", "[NoDRM]-iptd00916hhb1.mp4", "[NoDRM]-iptd00521hhb2.mp4", "(Ideapocket)(IDBD-403)321イク~!発射間際からチュパチュパレロレロのフェラで大発射!かすみ果穂 竹内紗里奈 等_2.mp4", "(PRESTIGE)(IDBD-505)甘い誘惑 ハニートラップで男を誘うオンナ達 希崎ジェシカ 天海つばさ 冬月かえで 希志あいの Rio 等_1.mp4", "-ipz783hhb.mp4", "[NoDRM]-iptd00533hhb1.mp4", "(IDEAPOCKET)(IPZ-847)ノンフィクション…ほんとうにあったレ○プ事件を実写化「天海つばさ最後の凌辱作品」.mp4", "[NoDRM]-ipz00041hhb2.mp4", "【更多福利www.51fuliku.com-福利库】IPTD-706b.mp4", "【更多福利www.51fuliku.com-福利库】IDBD278-01.mp4", "[NoDRM]-ipz00135hhb3.mp4", "(IDEAPOCKET)(IPZ-838)DQN達に全身固定され失禁マグナムピストンFUCK 「動けない!」恨みを買った女教師の恥辱姦 天海つばさ.mp4", "[Thz.la]ipz-877.mp4", "[NoDRM]-iptd00533hhb3.mp4", "[456k.me]idbd-699.mp4", "(IDEAPOCKET)(IPZ-416)天海つばさ 並木優 240分W本指名SPECIAL 極上風俗4本番.mp4", "(IDEAPOCKET)(IPZ-925)超W痴女 容赦なし!手加減なし!ザーメンを根こそぎ搾り抜く!天海つばさ 里美ゆりあ.mp4", "[bbs.yzkof.com]IDBD-610 A[约战竞技场].mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_3.mp4", "[NoDRM]-ipz00058hhb1.mp4", "[Idea Pocket][idbd-278] 天海つばさのフェラチオ360分SP (Tsubasa Amami) B.mp4", "(IDEAPOCKET)(IPZ-391)大乱交 天海つばさ.mp4", "(IDEAPOCKET)(IPX-047)肉感ローアングルで魅せるノーブラ透け乳首の巨乳お姉さんの誘い 勃起必須シチュエーションの連発 天海つばさ.mp4", "(IdeaPocket)OL痴漢電車 - 天海つばさ B.mp4", "[Thz.la]IPZ-573.1080p.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_6.mp4", "[456k.me]ipx-395-C.mp4", "(IDEAPOCKET)(IPVR-035)レジェンドVR共演 常に2人がかりでアナタを満足させてくれるハイクオリティ風俗 天海つばさ 佐山愛_7.mp4", "[Thz.la]rbd-794.mp4", "【更多福利www.51fuliku.com-福利库】IPTD-706a.mp4", "[NoDRM]-ipz00135hhb2.mp4", "(IDEAPOCKET)(IPZ-997)New Spermania 大量口内射精!大量顔面ぶっかけ!性獣達の特濃ザーメン群が弾丸の如く大放射!天海つばさ.mp4", "(IDEAPOCKET)(IPZ-909)BURN!BURN!BURN!日サロ店員のイキ過ぎた接客 日焼けもいいけど「つばさ」とのエッチな記憶も焼きつけて 天海つばさ.mp4", "[NoDRM]-iptd00521hhb3.mp4", "(IDEAPOCKET)(IPZ-814)褒められヴァーチャル有頂天SEX ALL主観 「つばさ」がアナタのプレイを絶賛してくれたら 天海つばさ.mp4", "-sspd128hhb.mp4", "【更多福利www.51fuliku.com-福利库】IDBD-289 .mp4", "[NoDRM]-ipz00157hhb2.mp4", "(IDEAPOCKET)(IPZ-424)僕のお嫁さんはいつも全裸 天海つばさ.mp4"]; sort($arr); dump($arr); } /** * 根据秀人相册的模特名字以 500 个文件作为一个文件夹重新整理 * @return void */ public function test7() { $dir = "/Volumes/T7/Image/xr/xiuren"; // $dir = "/Users/shixuesen/Documents/otherSync/xiuren/"; $files = scandir($dir); $set = []; $toMoveFiles = []; foreach ($files as $file) { if ($file == "." || $file == ".." || $file == ".DS_Store" || starts_with($file, ".")) { continue; } preg_match("#期(\S+)写真#", $file, $matches); $owner_name = $matches[1]; // dump($owner_name);exit; $subDir = implode(DIRECTORY_SEPARATOR, [$dir, $file]); if (is_dir($subDir)) { $imageFiles = array_diff(scandir($subDir), [".", "..", ".DS_Store"]); foreach ($imageFiles as $imageFile) { $toMoveFiles[$owner_name][] = implode(DIRECTORY_SEPARATOR, [$subDir, $imageFile]); } } // if (array_key_exists($owner_name, $set)) { // $set[$owner_name] ++; // dump("$owner_name exists"); // } else { // $set[$owner_name] = 1; // } // dump($owner_name); } // exit; foreach ($toMoveFiles as $owner => $toMoveFile) { dump(count($toMoveFile)); $totalNum = count($toMoveFile); $n = floor($totalNum / 500); for ($i = 0; $i < $totalNum; $i++) { $trueDir = $dir . DIRECTORY_SEPARATOR . $owner . "_00" . floor($i / 500); if ($i % 500 == 0 && !is_dir($trueDir)) { mkdir($trueDir); } $newFile = $trueDir . DIRECTORY_SEPARATOR . pathinfo($toMoveFile[$i])["basename"]; dump("new file is " . $newFile); rename($toMoveFile[$i], $trueDir . DIRECTORY_SEPARATOR . pathinfo($toMoveFile[$i])["basename"]); } } exit; // dump($toMoveFiles); // $allV = 0; // foreach ($set as $k => $v) { // $allV += $v; // } // dump($set); // dump($allV); } public function test08() { $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.xiuren05.cc/XiuRen/index.html', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'authority: www.xiuren05.cc', 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'accept-language: zh-CN,zh;q=0.9', 'cache-control: no-cache', 'cookie: cfstatshowcookie=xiurenpc', 'pragma: no-cache', 'sec-ch-ua: "Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"', 'sec-ch-ua-mobile: ?0', 'sec-ch-ua-platform: "macOS"', 'sec-fetch-dest: document', 'sec-fetch-mode: navigate', 'sec-fetch-site: none', 'sec-fetch-user: ?1', 'upgrade-insecure-requests: 1', 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', ), )); $response = curl_exec($curl); curl_close($curl); echo $response; } public function test09() { $arr1 = ["1000429769590276", "1000430003210700", "1000429999260118", "1000429999400794", "1000429999400794", "1000430004520201", "1000430004530766", "1000430004850362", "1000430004850362", "1000430004870591", "1000429999950757", "1000430000060315", "1000430000140315", "1000430000160088", "1000430000200823", "1000430000290298", "1000430005170131", "1000430005220533", "1000430005290448", "1000430000380457", "1000430005310718", "1000430005880886", "1000430005960156", "1000430006260376", "1000430006740058", "1000430012360131", "1000430012500286", "1000430017330592", "1000430017510931", "1000430012830183", "1000430012900001", "1000430013560519", "1000430013881003", "1000430018940761", "1000430014210352", "1000430014320367", "1000430014600099", "1000430014750648", "1000430014770062", "1000430014780038", "1000430014790074", "1000430014800598", "1000430019470116", "1000430014810703", "1000430014820784", "1000430019500168", "1000430014850172", "1000430019520794", "1000430014870379", "1000430019530523", "1000430019560327", "1000430019570703", "1000430019580784", "1000430014890774", "1000430014900764", "1000430014910379", "1000430019620148", "1000430019640764", "1000430019680129", "1000430019690805", "1000430019700648", "1000430019710631", "1000430014970363", "1000430019880628", "1000430015150518", "1000430015170556", "1000430019990312", "1000430020050753", "1000430015310498", "1000430015310498", "1000430015440647", "1000430015520378", "1000430015840734", "1000430020730852", "1000430020760933", "1000430021080248", "1000430031840206", "1000430031910905", "1000430031980000", "1000430032000997", "1000430032040932", "1000430032110732", "1000430032160725", "1000430036990879", "1000430037010610", "1000430032440692", "1000430032480648", "1000430032850104", "1000430037550574", "1000430037630147", "1000430037700574", "1000430033130374", "1000430033130374", "1000430033190845", "1000430033320875", "1000430033320875", "1000430038330731", "1000430038330731", "1000430038450934", "1000430034010994", "1000430038740617", "1000430034360183", "1000430034780035", "1000430039480169", "1000430034990467", "1000430039520485", "1000430039530721", "1000430035060580", "1000430039550027", "1000430039560571", "1000430039560571", "1000430035110205", "1000430035170886", "1000430035760822", "1000430035900046", "1000430040080046", "1000430035980767", "1000430036051004", "1000430036240156", "1000430036240156"]; $arr2 = ["1000429769590276", "1000429999260118", "1000429999400794", "1000429999950757", "1000430000060315", "1000430000140315", "1000430000160088", "1000430000200823", "1000430000290298", "1000430000380457", "1000430003210700", "1000430004520201", "1000430004530766", "1000430004850362", "1000430004870591", "1000430005170131", "1000430005220533", "1000430005290448", "1000430005310718", "1000430005880886", "1000430005960156", "1000430006260376", "1000430006740058", "1000430012360131", "1000430012500286", "1000430012830183", "1000430012900001", "1000430013560519", "1000430013881003", "1000430014210352", "1000430014320367", "1000430014600099", "1000430014750648", "1000430014770062", "1000430014780038", "1000430014790074", "1000430014800598", "1000430014810703", "1000430014820784", "1000430014850172", "1000430014870379", "1000430014890774", "1000430014900764", "1000430014910379", "1000430014970363", "1000430015150518", "1000430015170556", "1000430015310498", "1000430015440647", "1000430015520378", "1000430015840734", "1000430017330592", "1000430017510931", "1000430018940761", "1000430019470116", "1000430019500168", "1000430019520794", "1000430019530523", "1000430019560327", "1000430019570703", "1000430019580784", "1000430019620148", "1000430019640764", "1000430019680129", "1000430019690805", "1000430019700648", "1000430019710631", "1000430019880628", "1000430019990312", "1000430020050753", "1000430020730852", "1000430020760933", "1000430021080248", "1000430031840206", "1000430031910905", "1000430031980000", "1000430032000997", "1000430032040932", "1000430032110732", "1000430032160725", "1000430032440692", "1000430032480648", "1000430032850104", "1000430033130374", "1000430033190845", "1000430033320875", "1000430034010994", "1000430034360183", "1000430034780035", "1000430034990467", "1000430035060580", "1000430035110205", "1000430035170886", "1000430035760822", "1000430035900046", "1000430035980767", "1000430036051004", "1000430036240156", "1000430036990879", "1000430037010610", "1000430037550574", "1000430037630147", "1000430037700574", "1000430038330731", "1000430038450934", "1000430038740617", "1000430039480169", "1000430039520485", "1000430039530721", "1000430039550027", "1000430039560571", "1000430040080046"]; // $arr1 = ["1000429769590276"]; // $arr2 = ["1000429999260118"]; $unique_arr = array_unique($arr1); // 获取重复数据的数组 $repeat_arr = array_diff_assoc($arr1, $unique_arr); dump($repeat_arr);exit; // sort($arr1); // dump($arr1); // sort($arr2); // dump($arr2); // dump(array_diff($arr1, $arr2)); } public function test10() { $weibo = new WeiboService(); $weibo->moveLastDayCount(); } public function test11() { // $s = file(); $s = file_get_contents("/Users/shixuesen/Downloads/univ.json"); $match = null; preg_match_all("#univNameCn:\s\"(.*)\",[\S|\s|\n]{0,500}\sscore:(.*),#", $s, $match); $map = []; $i = 1; foreach ($match[1] as $key => $value) { $map[$value] = $i++; } $e = json_encode($map); file_put_contents("/Users/shixuesen/Downloads/univ_e.json", $e); $f = file_get_contents("/Users/shixuesen/Downloads/univ_e.json"); dump(json_decode($f)); // dump($map); // echo json_last_error_msg(); } public function sqlGenerate($value = '') { $source = 'union SELECT SUBSTRING_INDEX(`biz_key` , "|", 1) as "商品ID", SUBSTRING_INDEX(SUBSTRING_INDEX(`biz_extend`, ",", 2), ":", -1) as "订单编号", `user_id` as "买家ID" , `post_time` as "晒单时间", floor(`evaluation_value` / 20) as "评分", `content` as "晒单内容", case when locate("精选", `tags`) > 0 THEN "是" else "否" END as "是否精选" FROM `evaluation_#1#` left JOIN `evaluation_content_#1#` ON `evaluation_#1#`.`evaluation_id` = `evaluation_content_#1#`.`evaluation_id` where `evaluation_value` BETWEEN 60 and 100 and `evaluation_content_#1#`.`content_type` = 1 '; for ($i = 0; $i < 512; $i++) { $r = str_replace("#1#", $i, $source); echo $r . "\n"; } } }