https://github.com/viddler/Video-Sitemaps
A simple way to create your own video sitemap files for your site.
- Download the latest version of this package.
- Place the scripts from the php folder on your server (the logs and sitemaps folder are optional)
- Update the example file to include the path to the correct viddler wrapper
- Update the example file with your Viddler API, username, password and path to save error logs (optional)
- Update the example file method call
create
to the correct path to the folder to save your sitemaps - Run
- Add all the files created to your robots.txt file (Sitemap: http://YOURSITE.com/sitemaps/video-sitemap.xml)
include '/path/to/your/viddler-api-wrapper';
include 'video-sitemap.php';
$sm = new Video_Sitemap('YOUR API KEY', 'YOUER VIDDLER USERNAME', 'YOUR VIDDLER PASSWORD', 'logs/');
$sm->create('sitemaps/');
$sm->stats();
This version will create multiple sitemaps if need be. There is a max of 50,000 videos per sitemap file. The script will figure this out for you save the correct number of files while incrementing each file by 1.
Please see notes/comments in the video-sitemap.php for more info.
Since this script, depending on your total public and domain restricted videos, can be quite resource intensive; it is recommended to only run it when you need to and not on demand. IE: Once a day from a cronjob on your server.
- 0.1 - June 11th, 2012
- Initial commit.
- PHP Helper created