bsl_audioscrobbler 05/04/2005
This is an update of an update of the Audioscrobbler plugin developed by Bradley Law
bsl_audioscrobbler had two minor annoyances:
- it did not check whether the Audioscrobbler feed contained any songs
- it did not check whether the number of songs in the feed was smaller than the limit set in the tag
Download
Usage
<txp:bsl_audioscrobbler limit="5" username="ruairimccomb" form="audioscrobbler" usecache="1" cachepath="./as_cache"/>
Will output a list of the five most recently played songs by the user ruairimccomb. The form audioscrobbler will be used to output each song. Caching is turned on and will save the cache file in the ./as_cache directory, which is relative to the index.php file in the root of your txp site (not the index.php in your textpattern directory).
Attributes
limit : the amount of last played songs you wish to play (default – 10)username : your audioscrobbler username (default – bradlaylaw)form : the Textpattern form used for formatting. The plugin returns 3 values: Artist as txp:author, song title as txp:title, and link as txp:permlink. (default – audioscrobbler)usecache : set to 1 to use cache and 0 to not use cache (default – 0)cachepath : the path to a folder that you want to keep the cache file in. You may need to change the permissions on that folder to something like 777 (start there and work back). The folder must exist. (default – ./as_cache)cachefilename : the name of the cache file. It does not need to exist before hand (default – bsl_audioscrobbler.xml)cacheoldtime : the age of a cache file in seconds before it is considered obsolete and an attempt to refresh the cache is made. (default – 300)feedtimeout : time in seconds until the plugin gives up contacting audioscrobbler and falls back to cache. You will need to play around with this depending on what time you thing is suitable (sometimes the audioscrobbler site is really slow and needs a timeout of 20 seconds before it makes a succesful download) (default – 10)notworkingmessage : the message to display if the cache is not being used and the audioscrobbler site is not avaliable (default – rdf feed not avaliable and cache not present)notworkingform : the form to display if the cache is not being used and the audioscrobbler site is not avaliable (default – none)notlisteningmessage : the message to display if the audioscrobbler feed does not contain any recenly played tracks (default – not listening to music)notlisteningform : the form to display if the cache is not being used and the audioscrobbler site is not avaliable (default – none)preventcaching : set to 1 to prevent a cached response from the audioscrobbler server (default – 0)
Changelog
Changes in 0.8
- new attribute
notlisteningmessage: the message to display when the Audioscrobbler feed does not contain any recenly played tracks.
Changes in 0.8.1
- new attribute
preventcaching: prevents caching of the response from audioscrobbler. - fixed headers not appearing correctly in the help page.
Changes in 0.9
- added attributes
notlisteningformandnotworkingform - fixed documentation
txp:linkis reallytxp:permlink