Transducer provides a way for advanced users to run their own custom scripts after uploading a podcast episode. These scripts can be treated as though they are run from the Terminal directly, which means you can use your preferred scripting language.
Custom scripts are currently experimental. If you use custom scripts and have a suggestion for how they can be better, please email me. Also, if you have any trouble coming up with the right script to solve your problem, feel free to email me as well—I’d love to help you out.
/Users/matthewpalmer/scripts/...
and not ./scripts/...
).
chmod +x /Users/matthewpalmer/scripts/script.sh
to make a file executable).
#!
). For example, when running a Shell script the file should start with #!/bin/sh
or for a Perl script #!/usr/bin/perl
.
Transducer executes scripts using the absolute path provided, and passes the following fields to the script as command line arguments in the order listed below.
As an example, if I enter /Users/matthewpalmer/scripts/wordpress.sh
as the script for an episode uploaded to Libsyn, Transducer executes the equivalent to the following Terminal command:
$ /Users/matthewpalmer/scripts/wordpress.sh "My Podcast Name" "Matthew Palmer"\ "#17: Episode title" "The episode description" "01:12:45" "43214632"\ "/Users/matthewpalmer/podcasts/episode-17.mp3"\ "http://traffic.libsyn.com/matthewpalmer/episode-17.mp3"
Here’s an example of a Shell script I wrote to create a new Jekyll post for an episode of my podcast.
#!/bin/sh # This script creates a new Jekyll post for a podcast episode uploaded to Libsyn. # Episode info from Transducer # Transducer passes each of these as command line arguments to your script episodeTitle=$3 episodeDescription=$4 episodeDuration=$5 episodeLength=$6 fileURL=$8 # Where Jekyll stores its post files postsDirectory="/Users/matthewpalmer/Desktop/" # Metadata for the post yaml="--- layout: episode title: \"$episodeTitle\" duration: \"$episodeDuration\" length: \"$episodeLength\" link: $fileURL subtitle: \"$episodeDescription\" ---" YMD=`date '+%Y-%m-%d'` # Write metadata to the file for the post echo "$yaml" > ${postsDirectory}/$YMD.markdown