Simple Script for Multiple Language Sitemaps


 
Thread Tools Search this Thread
Top Forums Web Development Simple Script for Multiple Language Sitemaps
# 1  
Old 12-17-2009
Simple Script for Multiple Language Sitemaps

Someone asked me to post a very simple script for creating multiple language sitemaps from a vbseo generated sitemap for vbulletin. You will need to create the required directories, change the paths and website name as appropriate.

This code could be easily wrapped in a simple while loop and made much smaller, of course. If anyone wants to put in a loop and simplify, please feel free to do so and repost. Thanks.

Code:
cp /var/www/vbseo_sitemap/data/*.xml.gz .
gzip -d *gz; sed -i 's/\/www.yoursite.com\//\/www.yoursite.com\/ar\//' *xml
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/ar/sitemap_index.xml.gz > /dev/null
echo "ar done"
sleep 2
gzip -d *gz; sed -i 's/\/ar\//\/cs\//' *xml;gzip *.xml; cp *gz ../cs
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/cs/sitemap_index.xml.gz > /dev/null
echo "cs done"
sleep 2
gzip -d *gz; sed -i 's/\/cs\//\/da\//' *xml;gzip *.xml; cp *gz ../da
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/da/sitemap_index.xml.gz > /dev/null
echo "da done"
sleep 2
gzip -d *gz; sed -i 's/\/da\//\/de\//' *xml;gzip *.xml; cp *gz ../de
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/de/sitemap_index.xml.gz > /dev/null
echo "de done"
sleep 2
gzip -d *gz; sed -i 's/\/de\//\/es\//' *xml;gzip *.xml; cp *gz ../es
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/es/sitemap_index.xml.gz > /dev/null
echo "es done"
sleep 2
gzip -d *gz; sed -i 's/\/es\//\/fi\//' *xml;gzip *.xml; cp *gz ../fi
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/fi/sitemap_index.xml.gz > /dev/null
echo "fi done"
sleep 2
gzip -d *gz; sed -i 's/\/fi\//\/fr\//' *xml;gzip *.xml; cp *gz ../fr
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/fr/sitemap_index.xml.gz > /dev/null
echo "fr done"
sleep 2
gzip -d *gz; sed -i 's/\/fr\//\/hu\//' *xml;gzip *.xml; cp *gz ../hu
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/hu/sitemap_index.xml.gz > /dev/null
echo "hu done"
sleep 2
gzip -d *gz; sed -i 's/\/hu\//\/it\//' *xml;gzip *.xml; cp *gz ../it
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/it/sitemap_index.xml.gz > /dev/null
echo "it done"
sleep 2
gzip -d *gz; sed -i 's/\/it\//\/ja\//' *xml
sed -i 's/\/ja\//\/jp\//' sitemap_index.xml;gzip *.xml; cp *gz ../jp
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/jp/sitemap_index.xml.gz > /dev/null
echo "jp done"
sleep 2
gzip -d *gz; sed -i 's/\/ja\//\/ko\//' *xml
sed -i 's/\/jp\//\/ko\//' sitemap_index.xml;gzip *.xml; cp *gz ../ko
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/ko/sitemap_index.xml.gz > /dev/null
echo "ko done"
sleep 2
gzip -d *gz; sed -i 's/\/ko\//\/nl\//' *xml;gzip *.xml; cp *gz ../nl
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/nl/sitemap_index.xml.gz > /dev/null
echo "nl done"
sleep 2
gzip -d *gz; sed -i 's/\/nl\//\/pl\//' *xml;gzip *.xml; cp *gz ../pl
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/pl/sitemap_index.xml.gz > /dev/null
echo "pl done"
sleep 2
gzip -d *gz; sed -i 's/\/pl\//\/pt\//' *xml;gzip *.xml; cp *gz ../pt
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/pt/sitemap_index.xml.gz > /dev/null
echo "pt done"
sleep 2
gzip -d *gz; sed -i 's/\/pt\//\/ru\//' *xml;gzip *.xml; cp *gz ../ru
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/ru/sitemap_index.xml.gz > /dev/null
echo "ru done"
sleep 2
gzip -d *gz; sed -i 's/\/ru\//\/sv\//' *xml;gzip *.xml; cp *gz ../sv
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/sv/sitemap_index.xml.gz > /dev/null
echo "sv done"
sleep 2
gzip -d *gz; sed -i 's/\/sv\//\/th\//' *xml;gzip *.xml; cp *gz ../th
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/th/sitemap_index.xml.gz > /dev/null
echo "th done"
sleep 2
gzip -d *gz; sed -i 's/\/th\//\/tr\//' *xml;gzip *.xml; cp *gz ../tr
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/tr/sitemap_index.xml.gz > /dev/null
echo "tr done"
sleep 2
gzip -d *gz; sed -i 's/\/tr\//\/zh-CN\//' *xml;gzip *.xml; cp *gz ../zh-CN
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/zh-CN/sitemap_index.xml.gz > /dev/null
echo "zh-CN done"
sleep 2
gzip -d *gz; sed -i 's/\/zh-CN\//\/zh-TW\//' *xml;gzip *.xml; cp *gz ../zh-TW
wget -O http://www.google.com/webmasters/tools/ping?sitemap=http://www.yoursite.com/maps/zh-TW/sitemap_index.xml.gz > /dev/null
echo "zh-TW done"
sleep 2

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Covert simple bash script in perl language

Hello, Anyone please covert this in perl language ######################## if ps faux | grep -v grep | grep ProcessXYZ then echo "$SERVICE is running, , everything is fine" exit 0 else echo "$SERVICE is not running" exit 2 fi Additional... (1 Reply)
Discussion started by: fed.linuxgossip
1 Replies

2. Shell Programming and Scripting

Very simple script using bash language

Dear AIXians, I have a task for very simple script, but I can't write it correctly :confused: I have a file called (out.txt), if any line of this file starts with the word 'ORA', it must send email, if the file (out.txt) don't have this word, so it do nothing. Please tell me how. ... (4 Replies)
Discussion started by: Mohannad
4 Replies

3. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

4. Shell Programming and Scripting

need a script that does a simple task on multiple unix servers.

hi guys, i need a script that does a simple task on multiple aix servers. if possible with both telnet and ssh. the simple task i wanna do is connect to a server and run "ifconfig -a" and get the output. nextweek i need to do similar jobs on like 50 servers... :( can anybody help me with making... (2 Replies)
Discussion started by: curtis911
2 Replies

5. UNIX for Dummies Questions & Answers

best method of replacing multiple strings in multiple files - sed or awk? most simple preferred :)

Hi guys, say I have a few files in a directory (58 text files or somthing) each one contains mulitple strings that I wish to replace with other strings so in these 58 files I'm looking for say the following strings: JAM (replace with BUTTER) BREAD (replace with CRACKER) SCOOP (replace... (19 Replies)
Discussion started by: rich@ardz
19 Replies

6. UNIX for Dummies Questions & Answers

running a simple script file with multiple commands

I'm trying to run a script file with multiple commands that I would normally type into the command line. The commands are: #!/bin/bash diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences2 diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 >> differences2... (1 Reply)
Discussion started by: knelson
1 Replies

7. Shell Programming and Scripting

New simple language

Hi all, I need to 'create' a new simple scripting language in order to allow SCADA operators make complex tasks against the system in an easy and friendly way. In other words I need to write mini modules with DB readings or writings, calculations, and so on, but these instructions must be written... (2 Replies)
Discussion started by: silex
2 Replies

8. Programming

c language + simple question regarding memory addresses and ASCII characters

Just a simple question (which may seem silly so bear with me) that arose in my mind the other day. Do ASCII characters by themselves (e.g. /n, 0, a) have an actual memory address ? My question arises, because Im aware that each time I create and initalise a pointer like this for example int... (7 Replies)
Discussion started by: JamesGoh
7 Replies

9. UNIX for Advanced & Expert Users

How to design a simple multi tasking shell in unix using C language

can any one help me in designing a shell in unix like bash shell using c language plzzzzzzzzzzzzzzzzzzzz help (1 Reply)
Discussion started by: mobile01
1 Replies
Login or Register to Ask a Question