Tutorial: Currently playing song – \"Kung-Tunes\"
-
Hi
I don’t know if this is the right place to post this..if not, I’m sure an admin can move it to the right place…
Anyway…..
I had been having some trouble getting Kung-Tunes to display the last played songs in iTunes on my blog.
Ian Darlington at https://www.the-way-to-the-centre.org.uk/blog/ read about the problems I was having, and were so extremely kind to sit down and write me a complete tutorial.
I followed his tutorial step-by-step and everything went smooth..no problems at all…so in agreement with Ian I decided to post the tutorial here! Hopefully it can help a lot of newbies…like me ??
Tutorial:
1. Get kung-tunes to upload files – you need to set it up to transfer
to the root wp folder. For me the settings are:
Upload method: ftp
URL – https://ftp.the-way-to-the-centre.org.uk (my normal ftp path)
Proxy – field blank
File path – not needed for ftp (I think), mine is set to a local folder
on iBook
name – trackinfo.txt
FTP settings
Directory – /wordpress/ (the path to my wp root folder)
username – my ftp username
password – my ftp password
Only the use PASV-mode for file transfer box is ticked. (I think this
is the default)
2. If you get this all right, you should then be able to get
trackinfo.txt into your wp root when you click the upload now button.
3. For the formatting of the list on my blog I used:
^t#a #a#p [
for the current and recent tracks. But see
target="_blank">^p]#p
what you can do, it was a bit of trial and error for me.
4. Getting the tracklisting onto your blog.
There is a plugin – copy the following and save as something like
myitunes.php (you might want to check for any whitespaces, this caused
trouble for me).
<?php
/*
Plugin Name: My iTunes
Plugin URI: https://chrisjdavis.org/index/category/wp-hacks/
Description: A plugin that parses the text file created by Kung-Tunes
and displays it on your site.
Author: Chris J. Davis
Author URI: https://chrisjdavis.org/
*/
function display_tunes() {
$fp=fopen("trackinfo.txt","r");
$track=fgets($fp,1024);
echo "$track";
fclose($fp);
}
?>
5. upload it into your plugins folder and active.
6. Use<?php display_tunes() ?>
in your index where you want the
listing to appear.
All credits to Ian Darlington….(and Chris J Davis for the plugin)
Kind regards
Madsen
- The topic ‘Tutorial: Currently playing song – \"Kung-Tunes\"’ is closed to new replies.