Oh and one more Hack

Here is a tiny Wordpress hack that I wrote for myself that some other mac users out there might like to use.

This hack will take the file created by Kung-Tunes and parse it.  Just add this to your my-hacks.php.

function display_tunes() {
$fp=fopen("trackinfo.txt","r");
$track=fgets($fp,1024);
echo "$track";
fclose($fp); 
}

Pretty easy really.  Make sure to change the name of the file being called if it isn’t trackinfo.txt.

Here is a handy dandy plugin file for WordPress 1.2+

  1. personal avatar Christopher
    Stroll on over and visit Christopher
    March 1, 2007

    I would like to use this plugin. I have uploaded the plugin and I have installed Kung-Tunes and it is uploading the trackinfo.txt file.

    I have a few questions:

    -Should the trackinfo.txt file be in the root directory of the blog or somewhere else?

    - What should I place in my index template to display the most recent tracks?

    I apologize if this is extremely elementary.

    Thanks

  2. personal avatar Becca
    Stroll on over and visit Becca
    March 1, 2007

    I was also wondering how to do implement this. Is there anywhere I can find the template tags for this? Also, I’ve got KungTunes uploading to (root)/music, the blog is displayed at (root) and the plugin is located in (root)/wordpress/wp-content/plugins/wp-itunes.php . Is this going to work?

  3. personal avatar john plum
    Stroll on over and visit john plum
    March 1, 2007

    Thanks for the kung tunes hack/plug in. i shall use it.

Leave a Reply