|home > wimpy MP3 player > documentation > API||www.wimpyplayer.com|
SIFT stands for "Simple Flat Table" -- which is just an easier way to say, a simple UTF-8 text-based, flat-file, database table format.
By default, wimpy.php/asp/cfm returns Sift data (playlist) to the player. Using a Sift playlist is the most efficient way to get a large playlist into the player.
If the URL defined with wimpyApp ends with "xml" or "RSS," Wimpy will parse the incoming playlist data as if it were an XML playlist. If the URL does not end with "xml" or "RSS," Wimpy will parse the incoming playlist data as if it were a Sift-based playlist.
You can force Wimpy to always read incoming playlist data as if it were an XML playlist by using the forceXMLplaylist option -- regardless of whether the wimpyApp URL ends with "xml" or not. When forceXMLplaylist is set to "yes" Wimpy always reads the incoming playlist data as if it were and XML playlist.
Another sneaky way to "force" wimpy to recognize the incoming data as if it were an XML playlist is to tack on "?foo=bar.xml" to the end of the wimpyApp URL. This works because Wimpy only read the last three characters of the wimpyApp URL. When attempting to use this method, you must URL encode the '?foo=bar.xml" string as: %3Ffoo%3Dbar.xml so that the ? and or & symbols do not interfere with the other ? and & symbols that Wimpy uses to configure other settings.
The structure of a Sift playlist consists of three basic concepts: Items, Total Items and Data Setup. A simple example would look something like:
The efficiency of the Sift playlist hinges on the concept of creating a mini database table. Think of the "datasetup" variable as is if were the column names for a table. Each "item" would be a row in the table. The "totalitems" parameter defines how many items (or "rows") are available and enables Wimpy to iterate through the proper number of rows.
A pipe character is used to delimit each kind of data and allows for an association between datasetup and each "item." Think of the information between the pipes an "index" in an array -- or a "slot" to hold information.
When wimpy.php reads information about a track it puts the information into the proper "slot" -- if the data does not exist, or is un-readable, the slot is left empty, which ensures that the association between datasetup and the data for the item is maintained.
So for example, if datasetup is defined as:
&datasetup=filename | artist | title
And the artist name can not be determined, then the data for the item would be:
&item0=http://path/to/file.mp3 | | my song
Extra spaces were included above for clarity, the end result would actually be output as:
Each item must include a number immediately following the word "item," must start with zero and must be consecutive.
For example, to include three items in the playlist, you would output:
The order in which the numbers appear does not have to be orderly, but there should not be any "gaps" in the numbering:
As long as there are no gaps in the consecutive numbering, the data will load OK.
Also, be aware the the data between the pipes must be URL encoded, and **should** be UTF-8.