WikiPodcast
From Meta, a Wikimedia project coordination wiki
| WikiPodcast | |
|---|---|
| Type: | Special page extensions |
| Version | |
| Version: | 0.1 |
| Maturity: | Alpha |
| MediaWiki: | 1.5.x and higher |
| Last Updated: | 2006-05-29 |
| Description | |
| Aggregate all uploaded mp3s into a podcast RSS feed | |
| MediaWiki extensions | |
Contents |
[edit] Explanation
Ever wanted to host a podcast from your MediaWiki installation? There are some certain benefits to doing so-- currently the built-in RSS feed for MediaWiki is inclusive to "Recent changes" and a few other things custom tailored for RSS in MediaWiki. It occurred to me that with the massive amounts of music being uploaded to Wikipedia that some enterprising young fellow could turn their MediaWiki into a collaborative podcast. Brilliant, right?
So I went about going through the motions to create my own extension. Ran into a few issues along the way but I think I made everything work pretty well. There is currently full itunes support and the feed that generates validates perfectly (www.feedvalidator.org). For anyone who has ever thought that a collaborative podcast might be a nifty thing feel free to check it out :)
[edit] What this Extension does
Basically the extension does a database query for all images uploaded with the extension .mp3 and aggregates them all together based on fields in the database. For instance, the artist becomes the user who uploaded the mp3, the description is the description given to the mp3 when it's uploaded into MediaWiki, etc... The feed can be referenced from Special:WikiPodcasts
[edit] README
Greetings,
Not much to say here. You'll want to pop the SpecialWikiPodcast.php file in the extensions directory of your WikiMedia installation. Then follow instructions at "How do I enable an extension?". This creates a page called Special:Wikipodcast that you can reference off of the Special Pages. This essentially becomes the Podcast stream for your entire MediaWiki site. The extension will poll the database for all uploaded files with an mp3 extension and fill in the information for the podcast into the RSS stream based on database values.
If you intend to host large files in your podcasts (in excess of 5 megs or so) then you'll have to make a few configuration changes. Specifically, you'll want to change the following:
php.ini: upload_max_filesize post_max_size memory_limit
in apache's config: LimitRequestBody
in mediawiki's LocalSettings.php: memory_limit
All of these settings directly influence the amount you're able to upload in a post request. Furthermore, there are a few changes that have to be made to enable mp3 uploads in MediaWiki:
In includes/DefaultSettings.php:
You'll need to add mp3 as a file that is able to be uploaded, such as:
$wgVerifyMimeType= false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'mp3' );
Lastly, I had issues with false positives inside of the Wikipedia's script-detection routine. I ended up disabling it and this appears to be a good thing to do for large files anyway, so in the includes/SpecialUpload.php:
Find the part that looks like this and comment it out by adding in the // at the beginning:
#check for htmlish code and javascript
// if( $this->detectScript ( $tmpfile, $mime ) ) {
// return new WikiErrorMsg( 'uploadscripted' );
// }
After that edit the podcast site-wide configuration in the PodcastConfig.php. It should be fairly straightforward.
Voila, you should be all done. Upload some podcasts and enjoy!
If you have any questions, email me at garavondik [at] yahoo.com
[edit] Download
The code in the extension is a bit messy. It's my first time coding a MediaWiki extension so use it at your own risk. All I can add is that it works, and works well. The feed generated completely validates. I'm sure there are some bugs and for the most part you'll want to avoid using non-UTF-8 characters as there is only limited checking done at the moment.
- Download here: MediaWiki-Podcasts.tar.gz