lol – probably nice & fun coding project, but i don’t really see the practical use
Anonymous
eryanv, i’m interested in it! as for itunes, which i use, the only way i could figure out how to do it is to look at the iTunes Music Library.xml file and parse it out to find the “Last Played” field has the most recent play date. i’m not a programmer, so i’ll leave that one to you or anyone else that wants to integrate itunes π unfortunately, this will make it a bit difficult seeing as there aren’t too many plugins for windows itunes, and applescript isn’t going to become windowsscript anytime soon.
there does seem to be a plugic from “listen-to”, but i haven’t heard good things about it.
real quick how does it get the info? is the plugin supposed to place it on your server via ftp or a call to your machine? if so, what about the world with dynamic ip’s? just a little confused, but this looks good! keep it up!
uplink
Thread Starter
eryanv
(@eryanv)
I can’t say much about iTunes, never used it myself, not owning a Mac π and not really wanting to depart from WinAmp on the rare occasion that I use Windows. XMMS was convienent because I’ve looked at plugins that have reported similar information and there are a bunch of functions available where all you need to do is call them to get whatever piece of info you need.
There’s really two plugins. One for WP (client) and the other for the music player (server). The PHP code gets uploaded to whereever your blog is being hosted, and a call to the get_song function somewhere in one of your pages. The plugin for the music player would reside on your machine so that it could dish out the information. Basically a client-server architecture.
As for the dynamic IP issue, let me give you a bit of background on what led me to create this. Originally the idea was simply a PHP script that would parse the output of XMMS InfoPipe (wrote the information out to a file) except there were some file permission errors. So I realized that I could get around this by using network sockets and a new plugin, which would also open it up to users of other music players. After I had finished and tested everything, only then did I realize that it was only really going to work for people who had static IP addresses. So anyways, I suppose most of that was pretty useless, but unless you use something like DynDNS to attach a name to your Dynamic IP, there’s not much you can do other than go in and change it manually in the function call.
Anonymous
Sorry about that last post.
But the B2 plugin for Newsgator supports the Playing right Now feature, even for iTunes on Windows.
And it appears that iTunes support some WMP scheme for broadcasting playing now details.
I have no idea what, but hopefully, it could give you a hint.
There’s a nice bit of donation-ware at http://www.kung-foo.tv/itti.php
Kung Tunes is an AppleScript application which reads the current track playing in iTunes and can also save the last x (configurable) tunes you’ve listened to. Very configurable, you can make it output any format (including php) files and even ftp them to the server. Then all you have to do is include the file, if you’ve set it up right.
Works on Apple only though.
Anonymous
Do you have some kind of script that will FTP a certain text file to a certain location?
Cause rhythmbox has a built-in option to perform commands everytime a song changes, and it could easily be used for this.
[email protected]
Thread Starter
eryanv
(@eryanv)
I don’t think the current design would support something like that.
I have added a function to the Wiki that will parse the file created by kung-tunes, and echo it to wherever you define. You can see it running on my site under Diggin on: in the menu.
Find it here: http://wiki.ww.wp.xz.cn/index.php/Display%20current%20iTunes%20Track%20info
Later
Jesuit
The code for parse a file vreated by using Kung tunes in the specified wordpress directory was given in th e wikki, ny Jesuit: where is that code placed?
“Pretty simple really. If you are using kung-tunes (http://www.kung-foo.tv/itti.php) to upload the currently playing track info from iTunes to your site, you can now easily parse that file and echo the styled output to a predetermined location. Code Follows:
function display_tunes() {
$fp=fopen(“trackinfo.txt”,”r”);
$track=fgets($fp,1024);
echo “$track”;
fclose($fp);
}”
kung tunes, iTunesBlogger, and other such programs, can typically use an HTTP POST method to send data direct to a PHP page/script on your site. That’s the method that I used for CG-WhatTunes, and it works great. Also, CG-WT integrates with CG-Amazon to provide cover art and amazon link for the current track, which lots of people wanted.
I should have the WP1.5 CG-WT update together in the next few days…
-d
hi there,
has anybody meanwhile adapted eryanv’s plug/hack to winamp?
thanks!
et
Dunno — you can always use CG-WhatTunes with WinAmp… π
-d
david, please check this thread!