By Jacob Klint (jklint@juno.com)
Created for the
UC Irvine Paul Merage School of Business
1/2006
XMLerator is a tool for publishing files via podcasting (ie, RSS). Its purpose is to browse specified directories for files matching certain criteria and insert information about those files into an XML file with RSS tags. Once the resulting file is made available from a web server, iTunes users can subscribe to your podcast simply by opening the file on your web server.
XMLerator is written in C# using Microsoft Visual Studio 2005 and the .NET 2.0 framework.
Download the latest version here: http://www.gsm.uci.edu/~dvdotnet/downloads/xmlerator.zip
This program was designed and implemented entirely by Jacob Klint (me) for the UC Irvine Paul Merage School of Business. I am currently (as of 1/2006) an undergraduate majoring in Information and Computer Science at UC Irvine and will graduate in June 2006. I plan to work in the Southern California area once I graduate and am actively pursuing job opportunities.
What is a podcast? It is a specialized RSS feed used for distributing audio, video, and PDF content.
How do I create a podcast? Create some audio, video, or a PDF. Then use an RSS XML file to publish the files.
How do I create RSS XML files? With XMLerator! (unless you're a glutton for punishment, then you do it by hand :) )
XMLerator creates the XML files that allow others to subscribe to your podcast. You provide the audio, video, and pdf files, and XMLerator will provide the necessary files to publish all the content. The last step is to provide access to these XML files via a web server. As an added benefit, XMLerator creates valid RSS files that can be read by any RSS-capable program (Mozilla Firefox, for instance). You can use it to publish any files via RSS, or just to publish a plain text feed.
There are a couple of ways for users to subscribe to your feed. The easiest way is to put a link of the following form on your webpage:
itpc://mywebserver.com/podcastfile.xml.
Note that this only works if iTunes is already installed on the user's computer. The other alternative is to open iTunes and enter the URL manually: go to the “Advanced” menu, choose “Subscribe to podcast...”, and enter the URL of one of your XML files.
For more information on podcasting, visit the Apple site at: http://www.apple.com/itunes/podcasts/techspecs.html
(note that XMLerator does not create tags for the iTunes music store. It is designed to be used with your own web server.)
For more information on RSS, check out the official RSS specifications: http://blogs.law.harvard.edu/tech/rss
XMLerator is designed for PC's running Microsoft Windows XP and the .NET 2.0 runtime environment (freely available at http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en). It will probably run fine under any version of Windows that has the .NET 2.0 runtime, but no guarantees. It may also run on other operating systems with the .NET environment installed, but I have made no effort to keep the code platform-agnostic, so some tweaking of the source code may be necessary.
XMLerator Copyright (C) 2006 Jacob Klint
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
exluding commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
If you have any commercial interest in this product, please contact the author:
Jacob Klint jklint@juno.com
command-line based, so it's easy to schedule and then forget about
flexible – there are several “wildcards” available for you to use when specifying parameters to the program, and you have several options controlling which directories and files are parsed and what metadata the output file contains
powerful – can recurse fully through an entire directory structure
compatible – produces XML files that comply with the RSS standard and are therefore usable by many clients – iTunes, Firefox, etc.
I have no definite plans to improve this project as it is more than sufficient for our purposes here at the school, but two major ideas come to mind:
implement a GUI. The XML engine is completely separate from the console interface, so creating a GUI is a simple matter of putting together a form that can gather parameters and pass them to the XML engine.
Create files compatible with the iTunes music store by writing iTunes tags in addition to the standard RSS tags
At the DOS command line (cmd.exe), use this line to run the program: XMLerator.exe “options.txt”. Alternatively, drag-and-drop a configuration file onto the XMLerator.exe file. Finally, you can schedule it to run regularly using the Windows task scheduler (in the control panel).
All configuration is done via text files. A sample file named “options.txt” is included with the executable. With this arrangement, you can easily create separate profiles for different folders and switch among them just by executing XMLerator with the name of a different config file passed to it on the command line.
The options file format is as follows:
[GENERAL]
basedirectory=c:\video\podcast
rssfilename=podcast.xml
linkbasedirectory=c:\video
aggregatefiles=true
includesubdirectories=true
[RSS]
Title=Test Podcast
Link=http://mywebsite.com/<DirectoryOffset><RssFileName>
Description=a test podcast
Category=Technology
ItemTitle=
ItemDescription=occured in folder "<DirectoryOffset>"
ItemLink=http://mywebsite.com/public/<DirectoryOffset><FileNameFull>
[FILEEXT]
mpg=video/mpeg
mp3=audio/mpeg
pdf=application/pdf
Any line starting with “//” is completely ignored. Quotation marks are not necessary anywhere, so don't insert them unless you mean for them to be there.
Each section is explained below.
basedirectory – the directory to begin in when looking for files to include (“c:\video\podcast”)
rssfilename – the name of the output XML file (“podcast.xml”); note that with each run, XMLerator automatically overwrites existing XML files without user intervention
linkbasedirectory – the base folder that your website provides public access to; this information is required because in order to create a valid hyperlink to your content, the XMLerator must know the offset from the base directory to append to your website's base URL.
For example, say I have the file “video.mp4” in the folder “c:\video\podcast\test” on the server for the website “http://mywebsite.com/”. Also, let's say that the folder “c:\video\podcast” is publicly accessible through that link. Then the correct hyperlink to video.mp4 would be “http//mywebsite.com/test/video.mp4”.
aggregatefiles – if true, XMLerator creates one and only one XML file that contains information for all valid files it found, regardless of which directory they reside in. Compare this to the “false” mode, where XMLerator creates a new XML file for every folder that contains any valid files. So you can have one podcast with everything, or multiple podcasts with separate content.
This option also affects the locations of the output files. If true, the one XML file containing information about all media is located in the first folder that XMLerator encounters with any content matching one of the specified file extensions. If false, XMLerator creates a new XML file in each directory that has valid files.
includesubdirectories – if true, XMLerator travels through every single directory below the base directory, and I do mean every directory, even those which are located several levels deeper than the current directory.
Here you specify the specific names for items in your podcast. Several powerful options are available.
The first few items relate to the podcast as a whole:
Title – a name for the podcast
Link – the URL for the podcast; either link directly to the XML file that XMLerator produces or redirect the user to that file
Description – a description of the podcast
Category – a general category for the podcast (Education, Technology, etc)
The remaining items relate to individual items within the podcast:
ItemTitle – the name pattern for each individual episode
ItemDescription – the description pattern for each individual episode
ItemLink - the link pattern for each individual episode
Now, your podcasts would not be very interesting if every episode and every podcast had the same title, descriptions, links, etc. Fortunately, there are several variables you can use within any of the RSS options that will be filled in by XMLerator:
<Directory> - the directory that the current file is located in with a “/” appended
<DirectoryOffset> - the full directory path of the current file with the text in “basedirectory” (General Options) removed from the beginning
<FileName> - the name of the current file, without the extension
<FileNameFull> - the name of the current file, with the extension
<RssFileName> - the name of the RSS file, as defined in “rssFileName” (General Options)
Finally, XMLerator knows some other formatting tricks:
If ItemTitle is left blank (“ItemTitle=”), XMLerator uses the name of the file as the title (same as using the variable <FileName>)
However, if the name of the file ends with “-mmddYYYY”, where mmddYYYY represents a date (“-01262006” would be Jan 1, 2006), then XMLerator removes that date (and the dash) from the filename, uses the date as the publishing date of the podcast episode, and using the remaining filename as the podcast episode title. If there is no date in the filename, XMLerator uses the current date as the publishing date.
To override the description field specified in RSS Options, include a text file named “filename(w/ extension).txt” and XMLerator will use its contents as the description for that one file. For example, to create a custom description for file “video.mp4”, I would place a text file containing the description named “video.mp4.txt” in the same directory as “video.mp4” prior to running XMLerator. Even if the “txt” file extension is included in the list of file extensions (File Extensions), these description files will not be included as files in their own right but only as description files.
This is a list of file extensions that will be included in the search. For iTunes compatibility, only put mp4, mov, m4v, mp3, and pdf extensions. In addition, RSS requires that for each file, the MIME type be specified. This is a code that indicates what type of content is available. For each file extension then, look up the code on this web page (or just google “mime types”):
http://www.webmaster-toolkit.com/mime-types.shtml
Some common MIME types are:
mp4=video/mpeg
mp3=audio/mpeg
pdf=application/pdf
XMLerator has some special handling for text files. When the “txt” extension is included in the list (MIME type text/plain), the complete text file is inserted in the RSS feed as its own description field. You can override this just as you would with any file by including a file named “filename(w/ extension).txt” in the same directory as the text file.
last updated: 1/29/2006