-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
68 lines (67 loc) · 2.84 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include "vendor/autoload.php";
use VenkateshKcet\Sitemap\Sitemap;
$sitemap = new Sitemap();
$array = [
'loc' => "https://pypi.org/search/?q=sitemap",
'images' => ["https://pypi.org/search/1.png", "https://pypi.org/search/2.png"],
'videos' => [
0 => [
"thumbnail_loc" => "https://www.example.com/thumbs/123.jpg",
"title" => "Grilling steaks for summer",
"description" => "Alkis shows you how to get perfectly done steaks every time",
"content_loc" => "http://streamserver.example.com/video123.mp4",
"player_loc" => "https://www.example.com/videoplayer.php?video=123",
"duration" => 600,
"expiration_date" => "2021-11-05T19:20:30+08:00",
"rating" => 4.2,
"view_count" => 12345,
"publication_date" => "2007-11-05T19:20:30+08:00",
"family_friendly" => "yes",
"restriction" => [
"relationship" => "allow",
"value" => ["IE", "GB", "US", "CA"]
],
"platform" => [
"relationship" => "allow",
"value" => ["web", "tv"]
],
"price" => [
"currency" => "EUR",
"value" => 1.99
],
"requires_subscription" => "yes",
"uploader" => [
"info" => "https://www.example.com/users/grillymcgrillerson",
"value" => "GrillyMcGrillerson"
],
"live" => "no",
"tag" => ["steak", "meat", "summer", "outdoor"]
],
1 => [
"thumbnail_loc" => "https://www.example.com/thumbs/123.jpg",
"title" => "Grilling steaks for summer",
"description" => "Alkis shows you how to get perfectly done steaks every time",
"content_loc" => "http://streamserver.example.com/video123.mp4",
"player_loc" => "https://www.example.com/videoplayer.php?video=123"
]
],
'news' => [
'publication' => [
'name' => 'The Example Times',
'language' => 'en'
],
'publication_date' => '2008-12-23',
'title' => 'Companies A, B in Merger Talks'
]
];
$sitemap->add_url($array);
// for($i = 0; $i < 10000; $i++) {
// $a = $sitemap->add_url($loc = $i.".com", $lastmod = "2020/02/02", $changefreq = "never", $priority = 1.0);
// }
$sitemap->write_sitemap(__DIR__, 1000);
$sitemap->write_sitemapIndex($folderPath = __DIR__, $path = "http://localhost/sitemap/");
// phpinfo();