tru_podcast: A podcasting plugin for Textpattern
filed under: geek, podcasting, textpattern, tru_podcast
5987 days ago
A friend of mine, Amitai, has been wanting podcasting support for his blog for a long while. He uses Textpattern, as I do, and it doesn’t support podcasting. Until recently, it was impossible to create a plugin to support it, but changes made in Textpattern 4.0.4 have made it possible. I therefore offered to help him create a podcasting plugin, and the net result was that I wrote it myself :)
I’m publishing it here as tru_podcast. It was designed to be simple, although I’m sure the feature requests are going to come piling in immediately, and it will grow. It supports Atom and RSS, with a single “enclosure” per article. The media file is specified via one of Textpattern’s custom fields.
I don’t actually use the plugin, but you can see it in use in Amitai’s music feed. Check out the feature list, releases, and usage instructions, and let me know what you think.
Enjoy!
Add a comment [2]
tru_podcast: Usage instructions
filed under: geek, podcasting, textpattern, tru_podcast
5987 days ago
To learn more about tru_podcast, check out the introductory article, the releases page, or the feature list.
Table of Contents
Installation
- Go to the releases page to get the latest release. Don’t save it – just open it in your browser.
- Scroll down a slight bit and follow the on-page instructions: copy/paste the big square block of characters into your Textpattern install, under Admin -> Plugins.
- Hit “Upload”.
- Remember to switch the plugin to “Active” in the plugin list.
Configuration
Step 1: Rename one of your custom fields
tru_podcast uses a custom field named “tru_podcast”. Name one of your unused custom fields “tru_podcast” on the Admin -> Preferences -> Advanced tab.
Step 2: Upload a media file (a podcast)
Whenever you want to create a new episode, upload a media file to a web server. You can use Textpattern’s “Files” features, if you want. (Note that it is possible to FTP large media files to Textpattern’s files
directory, and then use the “Files” tab in the admin to alert Textpattern that the file is there.)
Step 3: Start podcasting!
Find the tru_podcast
field on the “Write” tab. It will be hiding behind the “Advanced Options” link.
Put the URL of the media file into that field. If you uploaded a file through Textpattern’s “Files” interface, just put the ID# of the file into the tru_podcast
field. If the file is somewhere else on your web server, you can use a relative URL. Write whatever you want in the article, and save it.
That’s all it takes – the file will appear in your RSS and Atom feeds as an enclosure, and podcast clients (iTunes, for example) will identify it correctly.
You’ll probably want to install Rob Sable’s rss_admin_show_adv_opts, which will automatically expand the “Advanced Options” section of the “Write” page, when you are writing articles. That gives you easy access to the custom fields.
Step 4: Include links in your articles (Optional)
For people reading your site via their web browser, you can link to the media file from your articles with something like:
<txp:tru_podcast_if_podcast> This article has a podcast! <txp:tru_podcast_link linktext="Right here!" /> <txp:else /> No podcast here! </txp:tru_podcast_if_podcast>
Step 5: Use a category to create a podcast-only feed (Optional)
You don’t have to create a special RSS feed for podcasts – the “enclosures” will simply show up in your normal feed(s) any time you specify a media file – but you can do so if you want. Simply create a new category for all your podcasting, and use the feed for that category as your podcast-only feed.
Step 6: Other types of “podcasts” (Optional)
You don’t have to limit yourself to audio; tru_podcast supports any type of media (video, images, etc.). As long as your server knows the correct MIME type for your media, everything should work.
Step 7: Advanced configuration (Optional)
The source code of tru_podcast has a few well-commented settings (right at the top) that you might want to change, especially if you use Textpattern’s “Files” features for your podcasts and if you’re using a non-default /files/ directory. If you run into problems with your podcast clients, you might want to try editing the plugin and changing those settings to see if it helps. (I don’t know of any problems with any clients, at the moment.)
Tag reference
tru_podcast_link
This tag will generate an <a href...
link if the current article has a podcast URL set. The generated link will automatically have rel="enclosure"
set in case an old podcast client is looking for it. You can pass any attribute to this tag and it will be passed on to the <a>
tag, except linktext
as indicated below.
Attributes:
linktext
will set the content of the<a>...</a>
link. If you don’t specifylinktext
, it defaults to the URL of the media.- Any other attribute desired can be passed to the
<a>
. For example,<txp:tru_podcast_link linktext="test" junk="worthy" />
will generate this HTML:<a href="/some/media.url" junk="worthy">test</a>
tru_podcast_if_podcast
This conditional tag will render its contents if the current article has an associated media file (in the tru_podcast
custom field).
tru_podcast_get_url
This tag will return the URL of an associated media file, if any.
Attributes:
full="1"
tellstru_podcast_get_url
to convert relative URLs to full URLsprotocol
can be used in conjunction withfull="1"
to specify a protocol other than “http://” for the generated full URLs.convertnumber="0"
will turn off the automatic conversion of file index numbers (from Textpattern’s “Files” interface). This is only really useful if you want to get directly at the text entered into the tru_podcast custom field.
Add a comment [12]
tru_podcast: Feature list
filed under: geek, podcasting, textpattern, tru_podcast
5987 days ago
To learn more about tru_podcast, check out the introductory article, the releases page, or the usage instructions.
Core features
- “Enclosures” (1 per article) in RSS and Atom feeds
- Tags to generate links (in the article) to that enclosure
- Support for any media type, including audio, video, and images, with correct MIME-type handling
- Support for relative URLs
- Support for files uploaded via Textpattern’s “Files” feature
Known issues
None
tru_podcast: Releases
filed under: geek, podcasting, textpattern, tru_podcast
5987 days ago
To learn more about tru_podcast, check out the introductory article, the feature list, or the usage instructions.
Current Release
tru_podcast 1.2 (download)
In case anyone (ahem, schmonz) is still using this, it has been updated to work under Textpattern 4.4.1.