-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitemaps
executable file
·69 lines (62 loc) · 2.31 KB
/
sitemaps
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
69
#!/bin/bash
DOMAIN="http://www.netkiller.cn"
PUBLIC_HTML=~/public_html
if [ ! -z $1 ]; then
DOMAIN=$1
fi
lastmod=`date "+%Y-%m-%d"`
echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<?xml-stylesheet type="text/xsl" href="gss.xsl"?>'
echo '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">'
#echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
for htmlfile in $(find $PUBLIC_HTML/ -type f -name "*.html")
do
url=`echo $htmlfile | sed -e "s:$PUBLIC_HTML/::"`
echo ' <url>'
echo ' <loc>'${DOMAIN}'/'${url}'</loc>'
echo ' <lastmod>'${lastmod}'</lastmod>'
echo ' <changefreq>daily</changefreq>'
echo ' <priority>0.5</priority>'
echo ' </url>'
done
for htmlfile in $(find $PUBLIC_HTML/ -type f -name "*.epub")
do
url=`echo $htmlfile | sed -e "s:$PUBLIC_HTML/::"`
echo ' <url>'
echo ' <loc>'${DOMAIN}'/'${url}'</loc>'
echo ' <lastmod>'${lastmod}'</lastmod>'
echo ' <changefreq>daily</changefreq>'
echo ' <priority>0.5</priority>'
echo ' </url>'
done
for htmlfile in $(find $PUBLIC_HTML/ -type f -name "*.mobi")
do
url=`echo $htmlfile | sed -e "s:$PUBLIC_HTML/::"`
echo ' <url>'
echo ' <loc>'${DOMAIN}'/'${url}'</loc>'
echo ' <lastmod>'${lastmod}'</lastmod>'
echo ' <changefreq>daily</changefreq>'
echo ' <priority>0.5</priority>'
echo ' </url>'
done
for htmlfile in $(find $PUBLIC_HTML/ -type f -name "*.chm")
do
url=`echo $htmlfile | sed -e "s:$PUBLIC_HTML/::"`
echo ' <url>'
echo ' <loc>'${DOMAIN}'/'${url}'</loc>'
echo ' <lastmod>'${lastmod}'</lastmod>'
echo ' <changefreq>daily</changefreq>'
echo ' <priority>0.5</priority>'
echo ' </url>'
done
for htmlfile in $(find $PUBLIC_HTML/ -type f -name *.pdf)
do
url=`echo $htmlfile | sed -e "s:$PUBLIC_HTML/::"`
echo ' <url>'
echo ' <loc>'${DOMAIN}'/'${url}'</loc>'
echo ' <lastmod>'${lastmod}'</lastmod>'
echo ' <changefreq>daily</changefreq>'
echo ' <priority>0.5</priority>'
echo ' </url>'
done
echo "</urlset>"