This commit is contained in:
TL 2022-10-13 16:06:35 +08:00 committed by Edward Yang
parent ab79c6751b
commit e77f861efb
14 changed files with 810 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<?php
namespace App\Console\Commands;
use Beike\Services\SitemapService;
use Illuminate\Console\Command;
class Sitemap extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sitemap:generate';
/**
* The console command description.
*
* @var string
*/
protected $description = '生成网站站点地图sitemap.xml文件';
/**
* Execute the console command.
*
*/
public function handle()
{
SitemapService::gen();
dump('Success!');
}
}

14
config/sitemap.php Normal file
View File

@ -0,0 +1,14 @@
<?php
/* Simple configuration file for Laravel Sitemap package */
return [
'use_cache' => false,
'cache_key' => 'laravel-sitemap.'.config('app.url'),
'cache_duration' => 3600,
'escaping' => true,
'use_limit_size' => false,
'max_size' => null,
'use_styles' => true,
'styles_location' => '/vendor/sitemap/styles/',
'use_gzip' => false
];

View File

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" exclude-result-prefixes="s">
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>XML Sitemap (for Google News)</title>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery.tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
<script type="text/javascript"><![CDATA[
$(document).ready(function() {
$("#sitemap").tablesorter({sortList:[[6,1],[4,1]],widgets:['zebra']});
$('.url').click(function(){
window.open($(this).html());
return false;
});
});]]></script>
<style type="text/css">
body
{
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
color: #545353;
}
table
{
border: none;
border-collapse: collapse;
}
#sitemap tr.odd
{
background-color: #eee;
}
#sitemap tbody tr:hover
{
background-color: #ccc;
}
#sitemap tbody tr:hover td, #sitemap tbody tr:hover td a
{
color: #000;
}
#content
{
margin: 10px auto;
max-width: 960px;
}
.expl
{
margin: 10px 3px;
line-height: 1.3em;
}
.expl a, .expl a:visited, footer a, footer a:visited
{
color: #da3114;
font-weight: bold;
}
a
{
color: #000;
text-decoration: none;
}
a:visited
{
color: #777;
}
a:hover
{
text-decoration: underline;
}
td
{
font-size:11px;
}
th
{
text-align:left;
padding: 5px 20px 5px 5px;
font-size: 12px;
}
thead th
{
border-bottom: 1px solid #dedede;
cursor: pointer;
}
footer
{
margin:20px auto;
text-align:left;
max-width:100%;
}
.url:hover
{
cursor:pointer;
}
</style>
</head>
<body>
<div id="content">
<h2>XML Sitemap (for Google News)</h2>
<p class="expl">Generated by <a href="https://github.com.com/ultrono/laravel-sitemap" target="_blank" title="Sitemap generator for Laravel">ultrono-sitemap</a>. This is styled xml sitemap (for Google News), sorted by update date.</p>
<p class="expl">This sitemap contains <xsl:value-of select="count(s:urlset/s:url)"/> URLs.</p>
<table id="sitemap" class="tablesorter" border="1" cellpadding="3">
<thead>
<tr bgcolor="#9acd32">
<th style="text-align:left">URL</th>
<th style="text-align:left">Title</th>
<th style="text-align:left">Publisher</th>
<th style="text-align:left">Language</th>
<th style="text-align:left">Genres</th>
<th style="text-align:left">Access</th>
<th style="text-align:left">Updated at</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="s:urlset/s:url">
<tr>
<td class="url"><xsl:value-of select="s:loc"/></td>
<td><xsl:value-of select="news:news/news:title"/></td>
<td><xsl:value-of select="news:news/news:publication/news:name"/></td>
<td><xsl:value-of select="news:news/news:publication/news:language"/></td>
<td><xsl:value-of select="news:news/news:genres"/></td>
<td><xsl:value-of select="news:news/news:access"/></td>
<td><xsl:value-of select="concat(substring(news:news/news:publication_date,0,11),concat(' ', substring(news:news/news:publication_date,12,5)))"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<footer></footer>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

123
public/vendor/sitemap/styles/mobile.xsl vendored Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" exclude-result-prefixes="s">
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>XML Sitemap (for Feature Phones)</title>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery.tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
<script type="text/javascript"><![CDATA[
$(document).ready(function() {
$("#sitemap").tablesorter({sortList:[[0,1]],widgets:['zebra']});
$('.url').click(function(){
window.open($(this).html());
return false;
});
});]]></script>
<style type="text/css">
body
{
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
color: #545353;
}
table
{
border: none;
border-collapse: collapse;
width:100%;
margin:30px 0;
}
#sitemap tr.odd
{
background-color: #eee;
}
#sitemap tbody tr:hover
{
background-color: #ccc;
}
#sitemap tbody tr:hover td, #sitemap tbody tr:hover td a
{
color: #000;
}
#content
{
margin: 10px auto;
max-width: 960px;
}
.expl
{
margin: 10px 3px;
line-height: 1.3em;
}
.expl a, .expl a:visited, footer a, footer a:visited
{
color: #da3114;
font-weight: bold;
}
a
{
color: #000;
text-decoration: none;
}
a:visited
{
color: #777;
}
a:hover
{
text-decoration: underline;
}
td
{
font-size:11px;
}
th
{
text-align:left;
padding: 5px 20px 5px 5px;
font-size: 12px;
}
thead th
{
border-bottom: 1px solid #dedede;
cursor: pointer;
}
footer
{
margin:20px auto;
text-align:left;
max-width:100%;
}
.url:hover
{
cursor:pointer;
}
</style>
</head>
<body>
<div id="content">
<h2>XML Sitemap (for Feature Phones)</h2>
<p class="expl">Generated by <a href="https://github.com/ultrono/laravel-sitemap" target="_blank" title="Sitemap generator for Laravel">ultrono-sitemap</a>. This is styled xml sitemap (for feature phones).</p>
<p class="expl">This sitemap contains <xsl:value-of select="count(s:urlset/s:url)"/> URLs.</p>
<table id="sitemap" class="tablesorter" border="1" cellpadding="3">
<thead>
<tr bgcolor="#9acd32">
<th style="text-align:left">URL</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="s:urlset/s:url">
<tr>
<td class="url"><xsl:value-of select="s:loc"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<footer></footer>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9" exclude-result-prefixes="s">
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>XML Sitemap Index</title>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery.tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
<script type="text/javascript"><![CDATA[
$(document).ready(function() {
$("#sitemap").tablesorter({sortList:[[0,1]],widgets:['zebra']});
$('.url').click(function(){
window.open($(this).html());
return false;
});
});]]></script>
<style type="text/css">
body
{
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
color: #545353;
}
table
{
border: none;
border-collapse: collapse;
width:100%;
margin:30px 0;
}
#sitemap tr.odd
{
background-color: #eee;
}
#sitemap tbody tr:hover
{
background-color: #ccc;
}
#sitemap tbody tr:hover td, #sitemap tbody tr:hover td a
{
color: #000;
}
#content
{
margin: 10px auto;
max-width: 960px;
}
.expl
{
margin: 10px 3px;
line-height: 1.3em;
}
.expl a, .expl a:visited, footer a, footer a:visited
{
color: #da3114;
font-weight: bold;
}
a
{
color: #000;
text-decoration: none;
}
a:visited
{
color: #777;
}
a:hover
{
text-decoration: underline;
}
td
{
font-size:11px;
}
th
{
text-align:left;
padding: 5px 20px 5px 5px;
font-size: 12px;
}
thead th
{
border-bottom: 1px solid #dedede;
cursor: pointer;
}
footer
{
margin:20px auto;
text-align:left;
max-width:100%;
}
.url:hover
{
cursor:pointer;
}
</style>
</head>
<body>
<div id="content">
<h2>XML Sitemap Index</h2>
<p class="expl">Generated by <a href="https://github.com/ultrono/laravel-sitemap" target="_blank" title="Sitemap generator for Laravel">ultrono-sitemap</a>. This is styled xml sitemapindex, sorted by update date.</p>
<p class="expl">This sitemap contains <xsl:value-of select="count(s:sitemapindex/s:sitemap)"/> URLs.</p>
<table id="sitemap" class="tablesorter" border="1" cellpadding="3">
<thead>
<tr bgcolor="#9acd32">
<th style="text-align:left">URL</th>
<th style="text-align:left">Updated at</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="s:sitemapindex/s:sitemap">
<tr>
<td class="url"><xsl:value-of select="s:loc"/></td>
<td><xsl:value-of select="concat(substring(s:lastmod,0,11),concat(' ', substring(s:lastmod,12,5)))"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<footer></footer>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

133
public/vendor/sitemap/styles/xml.xsl vendored Normal file
View File

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" exclude-result-prefixes="s">
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>XML Sitemap</title>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery.tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
<script type="text/javascript"><![CDATA[
$(document).ready(function() {
$("#sitemap").tablesorter({sortList:[[6,1],[4,1]],widgets:['zebra']});
$('.url').click(function(){
window.open($(this).html());
return false;
});
});]]></script>
<style type="text/css">
body
{
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
color: #545353;
}
table
{
border: none;
border-collapse: collapse;
}
#sitemap tr.odd
{
background-color: #eee;
}
#sitemap tbody tr:hover
{
background-color: #ccc;
}
#sitemap tbody tr:hover td, #sitemap tbody tr:hover td a
{
color: #000;
}
#content
{
margin: 10px auto;
max-width: 960px;
}
.expl
{
margin: 10px 3px;
line-height: 1.3em;
}
.expl a, .expl a:visited, footer a, footer a:visited
{
color: #da3114;
font-weight: bold;
}
a
{
color: #000;
text-decoration: none;
}
a:visited
{
color: #777;
}
a:hover
{
text-decoration: underline;
}
td
{
font-size:11px;
}
th
{
text-align:left;
padding: 5px 20px 5px 5px;
font-size: 12px;
}
thead th
{
border-bottom: 1px solid #dedede;
cursor: pointer;
}
footer
{
margin:20px auto;
text-align:left;
max-width:100%;
}
.url:hover
{
cursor:pointer;
}
</style>
</head>
<body>
<div id="content">
<h2>XML Sitemap</h2>
<p class="expl">Generated by <a href="https://gitlab.com/ultrono/laravel-sitemap" target="_blank" title="Sitemap generator for Laravel">ultrono/laravel-sitemap</a>. This is styled xml sitemap, sorted by update date.</p>
<p class="expl">This sitemap contains <xsl:value-of select="count(s:urlset/s:url)"/> URLs.</p>
<table id="sitemap" class="tablesorter" border="1" cellpadding="3">
<thead>
<tr bgcolor="#9acd32">
<th style="text-align:left">URL</th>
<th style="text-align:left">Alternates</th>
<th style="text-align:left">Images</th>
<th style="text-align:left">Videos</th>
<th style="text-align:left">Priority</th>
<th style="text-align:left">Update freq</th>
<th style="text-align:left">Updated at</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="s:urlset/s:url">
<tr>
<td class="url"><xsl:value-of select="s:loc"/></td>
<td><xsl:value-of select="count(xhtml:link)"/></td>
<td><xsl:value-of select="count(image:image)"/></td>
<td><xsl:value-of select="count(video:video)"/></td>
<td><xsl:value-of select="concat(s:priority*100,'%')"/></td>
<td><xsl:value-of select="s:changefreq"/></td>
<td><xsl:value-of select="concat(substring(s:lastmod,0,11),concat(' ', substring(s:lastmod,12,5)))"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<footer></footer>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,48 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
<?php
if ($item['lastmod'] !== null) {
echo '<lastmod>'.date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])).'</lastmod>'."\n";
}
?>
<?php
if (! empty($item['alternates'])) {
foreach ($item['alternates'] as $alternate) {
echo '<xhtml:link rel="alternate" media="'.$alternate['media'].'" href="'.$alternate['url'].'" />'."\n";
}
}
?>
<news:news>
<news:publication>
<news:name><?= $item['googlenews']['sitename'] ?></news:name>
<news:language><?= $item['googlenews']['language'] ?></news:language>
</news:publication>
<news:publication_date><?= date('Y-m-d\TH:i:sP', strtotime($item['googlenews']['publication_date'])) ?></news:publication_date>
<news:title><?= $item['title'] ?></news:title>
<?php
if (isset($item['googlenews']['access'])) {
echo "\t\t".'<news:access>'.$item['googlenews']['access'].'</news:access>'."\n";
}
if (isset($item['googlenews']['keywords'])) {
echo "\t\t".'<news:keywords>'.implode(',', $item['googlenews']['keywords']).'</news:keywords>'."\n";
}
if (isset($item['googlenews']['genres'])) {
echo "\t\t".'<news:genres>'.implode(',', $item['googlenews']['genres']).'</news:genres>'."\n";
}
if (isset($item['googlenews']['stock_tickers'])) {
echo "\t\t".'<news:stock_tickers>'.implode(',', $item['googlenews']['stock_tickers']).'</news:stock_tickers>'."\n";
}
?>
</news:news>
</url>
<?php endforeach; ?>
</urlset>

17
resources/views/vendor/sitemap/html.php vendored Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title><?= $channel['title'] ?></title>
</head>
<body>
<h1><a href="<?= $channel['link'] ?>"><?= $channel['title'] ?></a></h1>
<ul>
<?php foreach ($items as $item) : ?>
<li>
<a href="<?= $item['loc'] ?>"><?= (empty($item['title'])) ? $item['loc'] : $item['title'] ?></a>
<small>(last updated: <?= date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) ?>)</small>
</li>
<?php endforeach; ?>
</ul>
</body>
</html>

View File

@ -0,0 +1,18 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n"; ?>
<rdf:RDF xmlns="http://rorweb.com/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Resource rdf:about="sitemap">
<title><?= $channel['title'] ?></title>
<url><?= $channel['link'] ?></url>
<type>sitemap</type>
</Resource>
<?php foreach ($items as $item) : ?>
<Resource>
<url><?= $item['loc'] ?></url>
<title><?= $item['title'] ?></title>
<updated><?= date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) ?></updated>
<updatePeriod><?= $item['freq'] ?></updatePeriod>
<sortOrder><?= $item['priority'] ?></sortOrder>
<resourceOf rdf:resource="sitemap"/>
</Resource>
<?php endforeach; ?>
</rdf:RDF>

View File

@ -0,0 +1,17 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n"; ?>
<rss version="2.0" xmlns:ror="http://rorweb.com/0.1/" >
<channel>
<title><?= $channel['title'] ?></title>
<link><?= $channel['link'] ?></link>
<?php foreach ($items as $item) : ?>
<item>
<link><?= $item['loc'] ?></link>
<title><?= $item['title'] ?></title>
<ror:updated><?= date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) ?></ror:updated>
<ror:updatePeriod><?= $item['freq'] ?></ror:updatePeriod>
<ror:sortOrder><?= $item['priority'] ?></ror:sortOrder>
<ror:resourceOf>sitemap</ror:resourceOf>
</item>
<?php endforeach; ?>
</channel>
</rss>

View File

@ -0,0 +1,14 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n"; ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach ($sitemaps as $sitemap) : ?>
<sitemap>
<loc><?= $sitemap['loc'] ?></loc>
<?php if ($sitemap['lastmod'] !== null) : ?>
<lastmod><?= date('Y-m-d\TH:i:sP', strtotime($sitemap['lastmod'])) ?></lastmod>
<?php endif; ?>
</sitemap>
<?php endforeach; ?>
</sitemapindex>

View File

@ -0,0 +1,5 @@
<?php
foreach ($items as $item) {
echo $item['loc']."\n";
}

View File

@ -0,0 +1,12 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
<mobile:mobile/>
</url>
<?php endforeach; ?>
</urlset>

118
resources/views/vendor/sitemap/xml.php vendored Normal file
View File

@ -0,0 +1,118 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
<?php
if (! empty($item['translations'])) {
foreach ($item['translations'] as $translation) {
echo "\t\t".'<xhtml:link rel="alternate" hreflang="'.$translation['language'].'" href="'.$translation['url'].'" />'."\n";
}
}
if (! empty($item['alternates'])) {
foreach ($item['alternates'] as $alternate) {
echo "\t\t".'<xhtml:link rel="alternate" media="'.$alternate['media'].'" href="'.$alternate['url'].'" />'."\n";
}
}
if ($item['priority'] !== null) {
echo "\t\t".'<priority>'.$item['priority'].'</priority>'."\n";
}
if ($item['lastmod'] !== null) {
echo "\t\t".'<lastmod>'.date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])).'</lastmod>'."\n";
}
if ($item['freq'] !== null) {
echo "\t\t".'<changefreq>'.$item['freq'].'</changefreq>'."\n";
}
if (! empty($item['images'])) {
foreach ($item['images'] as $image) {
echo "\t\t".'<image:image>'."\n";
echo "\t\t\t".'<image:loc>'.$image['url'].'</image:loc>'."\n";
if (isset($image['title'])) {
echo "\t\t\t".'<image:title>'.$image['title'].'</image:title>'."\n";
}
if (isset($image['caption'])) {
echo "\t\t\t".'<image:caption>'.$image['caption'].'</image:caption>'."\n";
}
if (isset($image['geo_location'])) {
echo "\t\t\t".'<image:geo_location>'.$image['geo_location'].'</image:geo_location>'."\n";
}
if (isset($image['license'])) {
echo "\t\t\t".'<image:license>'.$image['license'].'</image:license>'."\n";
}
echo "\t\t".'</image:image>'."\n";
}
}
if (! empty($item['videos'])) {
foreach ($item['videos'] as $video) {
echo "\t\t".'<video:video>'."\n";
if (isset($video['thumbnail_loc'])) {
echo "\t\t\t".'<video:thumbnail_loc>'.$video['thumbnail_loc'].'</video:thumbnail_loc>'."\n";
}
if (isset($video['title'])) {
echo "\t\t\t".'<video:title><![CDATA['.$video['title'].']]></video:title>'."\n";
}
if (isset($video['description'])) {
echo "\t\t\t".'<video:description><![CDATA['.$video['description'].']]></video:description>'."\n";
}
if (isset($video['content_loc'])) {
echo "\t\t\t".'<video:content_loc>'.$video['content_loc'].'</video:content_loc>'."\n";
}
if (isset($video['duration'])) {
echo "\t\t\t".'<video:duration>'.$video['duration'].'</video:duration>'."\n";
}
if (isset($video['expiration_date'])) {
echo "\t\t\t".'<video:expiration_date>'.$video['expiration_date'].'</video:expiration_date>'."\n";
}
if (isset($video['rating'])) {
echo "\t\t\t".'<video:rating>'.$video['rating'].'</video:rating>'."\n";
}
if (isset($video['view_count'])) {
echo "\t\t\t".'<video:view_count>'.$video['view_count'].'</video:view_count>'."\n";
}
if (isset($video['publication_date'])) {
echo "\t\t\t".'<video:publication_date>'.$video['publication_date'].'</video:publication_date>'."\n";
}
if (isset($video['family_friendly'])) {
echo "\t\t\t".'<video:family_friendly>'.$video['family_friendly'].'</video:family_friendly>'."\n";
}
if (isset($video['requires_subscription'])) {
echo "\t\t\t".'<video:requires_subscription>'.$video['requires_subscription'].'</video:requires_subscription>'."\n";
}
if (isset($video['live'])) {
echo "\t\t\t".'<video:live>'.$video['live'].'</video:live>'."\n";
}
if (isset($video['player_loc'])) {
echo "\t\t\t".'<video:player_loc allow_embed="'.$video['player_loc']['allow_embed'].'" autoplay="'.
$video['player_loc']['autoplay'].'">'.$video['player_loc']['player_loc'].'</video:player_loc>'."\n";
}
if (isset($video['restriction'])) {
echo "\t\t\t".'<video:restriction relationship="'.$video['restriction']['relationship'].'">'.$video['restriction']['restriction'].'</video:restriction>'."\n";
}
if (isset($video['gallery_loc'])) {
echo "\t\t\t".'<video:gallery_loc title="'.$video['gallery_loc']['title'].'">'.$video['gallery_loc']['gallery_loc'].'</video:gallery_loc>'."\n";
}
if (isset($video['price'])) {
echo "\t\t\t".'<video:price currency="'.$video['price']['currency'].'">'.$video['price']['price'].'</video:price>'."\n";
}
if (isset($video['uploader'])) {
echo "\t\t\t".'<video:uploader info="'.$video['uploader']['info'].'">'.$video['uploader']['uploader'].'</video:uploader>'."\n";
}
echo "\t\t".'</video:video>'."\n";
}
}
?>
</url>
<?php endforeach; ?>
</urlset>