Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-02-14 22:06:47

supa
Archived Plugin Author
Registered: 2005-02-10
Posts: 27
Website

[archived] sab_NowPlaying: Display a Now Playing XML feed

Notice: This thread is archived, this plugin is no longer available.

**********************************************************

http://www.bluecamel.org/software/textpattern/sab_NowPlaying.txt

Description:

  • This plugin will display songs from a Now Playing -style XML file in TextPattern.
The ultimate goal of this project is to make available any and all data in the XML file output by the Now Playing iTunes visualizer by Brandon Fuller

Features:

  • The most configurable Now Playing TextPattern plugin out there!</li>
  • Uses a form for a template.</li>
  • Will show any information available in the Now Playing XML file. [1]</li>

Usage:

<ol> <li> Install and activate plugin</li> <li> Where ever you want your list to display, add the call to the plugin. Available options are: <ul> <li> xmlfileREQUIRED – Relative path to the XML file.</li> <li> formOPTIONAL – the name of the form that will be used to generate a “line”. If left unspecified

&lt;li&gt;&lt;span class=‘artist’&gt;&lt;txp:sab_NowPlaying_artist /&gt;&lt;/span&gt; – &lt;span class=‘title’&gt;&lt;txp:sab_NowPlaying_title /&gt;&lt;/span&gt;&lt;/li&gt;

will be used.

For example:

&lt;txp:sab_NowPlaying xmlfile=“itunes.xml” form=“now_listening” /&gt;

</li> </ul> </li> <li> If you specified a form, create it now. Options are: <ul> <li> &lt;txp:sab_NowPlaying_title /&gt; – Track title <li> &lt;txp:sab_NowPlaying_artist /&gt; – Track artist <li> &lt;txp:sab_NowPlaying_album /&gt; – Track album <li> &lt;txp:sab_NowPlaying_genre /&gt; – Track genre <li> &lt;txp:sab_NowPlaying_kind /&gt; – Type of track (“MPEG Layer 3”, for example) <li> &lt;txp:sab_NowPlaying_numtracks /&gt; – Total number of tracks on the album <li> &lt;txp:sab_NowPlaying_track /&gt; – Track number <li> &lt;txp:sab_NowPlaying_year /&gt; – Track/Album year <li> &lt;txp:sab_NowPlaying_comments /&gt; – Comments embeded in the music file <li> &lt;txp:sab_NowPlaying_time /&gt; – Track length, time-wise <li> &lt;txp:sab_NowPlaying_bitrate /&gt; – Track bitrate <li> &lt;txp:sab_NowPlaying_rating /&gt; – Track rating in iTunes <li> &lt;txp:sab_NowPlaying_numdiscs /&gt; – Number of discs total in the set (if the album is from a boxed set, for example) <li> &lt;txp:sab_NowPlaying_disc /&gt; – Disc number (see &lt;txp:sab_NowPlaying_numdiscs /&gt;) <li> &lt;txp:sab_NowPlaying_playcount /&gt; – Total number of times this track has been played <li> &lt;txp:sab_NowPlaying_compilation /&gt; – “Yes” or “No”, depending if the track came from a compilation album <li> &lt;txp:sab_NowPlaying_composer /&gt; – Track composer <li> &lt;txp:sab_NowPlaying_grouping /&gt; – Uhh… dunno <li> &lt;txp:sab_NowPlaying_urlamazon&gt;Text&lt;/txp:sab_NowPlaying_urlamazon&gt; – make “Text” a link to your Amazon associate account. If this field is empty in the XML file, this will be ignored but “Text” will still be displayed. <li> &lt;txp:sab_NowPlaying_urlapple&gt;Text&lt;/txp:sab_NowPlaying_title&gt; – make “Text” a link to your Apple associate account. If this field is empty in the XML file, this will be ignored but “Text” will still be displayed. <li> &lt;txp:sab_NowPlaying_image /&gt;URL to the cover art image. If this tag is in your form, sab_NowPlaying will automatically convert the URL to an apporpriate &lt;IMG /&gt; tag. Available attributes are: <ul> <li> link= – “amazon”, “apple”, or “source” – This will automatically make the image a link to the appropriate associate account. For example:

&lt;txp:sab_NowPlaying_image link=“amazon” /&gt;

</li> <li> class= – This will add a class attribute to your &lt;IMG /&gt; tag to let you control the appearance using CSS.</li> </ul> </li> <li> &lt;txp:sab_NowPlaying_urlsource /&gt; – Uh, I dunno but functions the same as &lt;txp:sab_NowPlaying_urlapple /&gt; and &lt;txp:sab_NowPlaying_urlamazon /&gt;</li> </ul> </li> <li>Listen to some music!</li> </ol>

TODO:

  • Add support for Last Modified for each track
  • Add support for Last Modified for whole playlist

1 It doesn’t show everything just yet, but it’s getting there!

-Steve

P.S. I’m not even going to try and format this right. Help is available when you install the plugin or at my website

Last edited by supa (2005-02-14 22:08:06)

Offline

#2 2005-02-15 04:34:56

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: [archived] sab_NowPlaying: Display a Now Playing XML feed

Cool stuff, I’ll try it out soon, thx !!!

Just one thing : you seem to have forgotten the code tags to wrap your txp tags… (copy/paste I guess)

example : <code><txp:sab_NowPlaying_title /></code> – Track title
is displayed with ** (guess you were intending to put it in bold)

Last edited by davidm (2005-02-15 04:35:53)


.: Retired :.

Offline

#3 2005-02-15 12:18:57

supa
Archived Plugin Author
Registered: 2005-02-10
Posts: 27
Website

Re: [archived] sab_NowPlaying: Display a Now Playing XML feed

<em> davidm wrote:

Cool stuff, I’ll try it out soon, thx !!!

Just one thing : you seem to have forgotten the code tags to wrap your txp tags… (copy/paste I guess)

example : <code><txp:sab_NowPlaying_title /></code> – Track title
is displayed with ** (guess you were intending to put it in bold)
</em>

Yeah, I know.. I’m sick of messing with formatting whenever I post something on this BBS. If you want to see it in all its glory, go to the post on my board or install the plugin and look at the help. :)

-Steve

Last edited by supa (2005-02-15 12:21:11)

Offline

#4 2005-02-15 17:50:17

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: [archived] sab_NowPlaying: Display a Now Playing XML feed

OK never mind… I did not intend to bug you with this.

I did check your website, no pb. Great work !


.: Retired :.

Offline

Board footer

Powered by FluxBB