s11
This commit is contained in:
26
.hta_slug/sitemap-generate.php
Normal file
26
.hta_slug/sitemap-generate.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
// stream.php
|
||||||
|
|
||||||
|
header("Content-Type: text/event-stream");
|
||||||
|
header("Cache-Control: no-cache");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
$siteId = file_get_contents("current_site.txt");
|
||||||
|
|
||||||
|
for ($i = 1; $i <= 5; $i++) {
|
||||||
|
echo "data: " . json_encode([
|
||||||
|
"type" => "update",
|
||||||
|
"message" => "Crawling page $i..."
|
||||||
|
]) . "\n\n";
|
||||||
|
ob_flush();
|
||||||
|
flush();
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "data: " . json_encode([
|
||||||
|
"type" => "complete",
|
||||||
|
"site_id" => trim($siteId)
|
||||||
|
]) . "\n\n";
|
||||||
|
|
||||||
|
ob_flush();
|
||||||
|
flush();
|
||||||
Reference in New Issue
Block a user