SEO for the OLPC wiki/sitemapgen: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 60: | Line 60: | ||
echo All done |
echo All done |
||
</pre> |
</pre> |
||
== Use == |
|||
The guys over at [http://appropedia.org Appropedia] are using this script over at their wiki as well: |
|||
* http://forum.appropedia.org/blog/finally-working-mediawiki-sitemap |
|||
[[Category:Wiki gang]] |
[[Category:Wiki gang]] |
Latest revision as of 02:02, 27 August 2008
This is a script, that when run in the /maintainence folder of mediawiki, will:
- Use Mediawiki's built-in sitemapgenerator script
- Cat all of the files from each name space
- Change the URL's to match the wiki naming scheme
- Ping google, etc. that this has been done
#!/bin/sh echo Sitemap script ... cd /home/www/wiki.laptop.org/maintenance/ php-cgi generateSitemap.php echo Sitemap script ... done echo Moving files, un'gz'ing ... mv -f *.gz ../ cd .. gzip -d *.xml.gz echo Moving files, un'gz'ing ... done echo Archiving old sitemap... mv sitemap.xml sitemap.xml.$(date "+%Y%m%d%H") echo Archiving old sitemap... done echo Cating all of the name spaces ... cat sitemap-wikidb-NS_*.xml > sitemap.xml echo Cating all of the name spaces ... done echo Replacing localhost with wiki.l.o ... sed -i 's,localhost,wiki.laptop.org,g' sitemap.xml echo Replacing localhost with wiki.l.o ... done echo Cleaning that up ... sed -i "/?xml version/d" sitemap.xml sed -i "/urlset/d" sitemap.xml echo Cleaning that up ... done echo Adding the XML headers back... echo "</urlset>" >> sitemap.xml sed -i '1i\ <?xml version="1.0" encoding="UTF-8"?>\ <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' sitemap.xml echo Adding the XML headers back... done echo Cleaning up the catd files ... rm sitemap-wikidb-NS* echo Cleaning up the catd files ... done echo Pinging the sitemap update to the search engines... wget -q -O /dev/null http://www.google.com/webmasters/tools/ping?sitemap=http://wiki.laptop.org/sitemap.xml wget -q -O /dev/null http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=http://wiki.laptop.org/site$ wget -q -O /dev/null http://submissions.ask.com/ping?sitemap=http://wiki.laptop.org/sitemap.xml wget -q -O /dev/null http://api.moreover.com/ping?u=http://wiki.laptop.org/sitemap.xml wget -q -O /dev/null http://webmaster.live.com/ping.aspx?siteMap=http://wiki.laptop.org/sitemap.xml echo Pinging the sitemap update to the search engines... done echo All done
Use
The guys over at Appropedia are using this script over at their wiki as well: