Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
I posted about this in another thread but it got lost and I had people asking about it. So here you go.
The iTunes plugin utilizing Brad Fuller’s XML iTunes XML Generator. <a href=“http://brandon.fuller.name/archives/hacks/nowplaying/”>Link</a>.
The current version utilizes the beta release of version 2 of his script, which incorporates Amazon.com info.
Use it by feeding an xmlfile attribute specifying the path to the itunes xml file generated by Fuller’s script. If you are playing iTunes the script is updated in real time. If it is closed, that information is reflected on screen.
<txp:it_ituneswin xmlfile=”/path/to/itunes.xml/” />
Screenshot: <a href=“http://www.emmense.com/blog”>Technosailor</a>
<a href=“http://www.emmense.com/downloads/it_ituneswin.txt”>Download</a>
Cheers,
Aaron
Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden
Offline
#2 2004-05-25 01:28:47
- Ray
- Member
- Registered: 2004-03-02
- Posts: 154
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
Thanks Aaron. Much appreciated.
Later,
Ray
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
Ok, I have everything installed; the XML file is being sent to my host. the plugin is activated within the TXP interface.
Now what? How do I insert this thing in my pages?
Thank you!
Last edited by Jennifer (2004-06-11 03:27:17)
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
<txp:fpx_ituneswin xmlfile=”/path/to/file.xml” />
Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
you might want to do a print_r() on the parsed xml to find which attributes you need to use. The ones in the function have changed several times. Everytime Brandon updates his NowPlaying plugin, the XML changes. It’s kind of a pain in the arse.
Aaron
Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
Thanks. Obviously, I need to make some changes to this because I guess he has changed his format yet again.
I have a mangled version of his code working on my site. I’ll sit down and compare it to yours, and see what I can figure out.
I think it’s time for me to buckle down and learn PHP… I know a few bits and that’s all.
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
are there any itunes now-playing plugins that aren’t shareware?
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
when playing, it’s linking to the genre (a href=“Rock”) and has an image icon_itunes.gif..
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
is there maybe a way to use $index to find the elements of the xml by name, rather than using element numbers?
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
This is what I’m using sucessfully right now:
<pre>function fpx_ituneswin($atts)
{
if (is_array($atts)) extract($atts);
$xml_parser = xml_parser_create();
if (($fp = fopen($xmlfile, “r”)))
{
$data = fread($fp, filesize($xmlfile));
fclose($fp);
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
$title = $vals[$index[“TITLE”]0][“value”];
$artist = $vals[$index[“ARTIST”]0][“value”];
$album = $vals[$index[“ALBUM”]0][“value”];
$amazonurl = $vals[$index[“URLAMAZON”]0][“value”];
$amazonimage = $vals[$index[“IMAGE”]0][“value”];
$albumData = array($title,$artist,$album,$amazonurl,$amazonimage);
}
$data = “<div id=\“itunes\”>”;
$data .=”<img style=\“float:left;\” src=\”“.$amazonimage.”\” /><strong>Current iTunes Song</strong><br />”;
if(!empty($title))
{
$title = ($amazonurl != ‘’) ? ‘<a href=”’.$amazonurl.’”>’.$title.’</a>’ : $title;
$data .=$title.” – “.$artist.”<br />”;
}
else
{
$data .=’<em>Not Playing.</em>’;
}
$data .=”</div>”;
return $data;
}
</pre>
Last edited by tmacwrig (2004-06-20 03:23:31)
Offline
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
a little bug – when nothing is playing, it wouln’t validate for XHTML Transitional (it has <pre><a href=></pre> as one of the tags). You can fix this by changing the line which says
<pre>
$data .=’<em>Not Playing.</em>’;
</pre>
to
<pre>
$data = ‘<em>Not Playing</em>’;
</pre>
Last edited by tmacwrig (2004-07-04 16:52:52)
Offline
#12 2004-07-08 19:51:13
- xenlab
- Member
- From: winter park, fl
- Registered: 2004-07-08
- Posts: 16
Re: [plugin] [ORPHAN] it_ituneswin: iTunes for Windows Official Release
what is the format for getting this plugin working?
< txp:fxp_ituneswin / > … hot to tell it where to look for my xml file? i just bought the plug-in and would love to get it working with my next textpattern site: http://xenlab.ezrpm.com/
thanks,
xenlab
http://www.xnlb.com/
Offline