1 /** The osmplayer namespace. */ 2 var osmplayer = osmplayer || {}; 3 4 /** The parser object. */ 5 osmplayer.parser = osmplayer.parser || {}; 6 7 /** 8 * The xsfp parser object. 9 * 10 * @return {object} The xsfp parser. 11 **/ 12 osmplayer.parser.xsfp = { 13 14 // The priority for this parser. 15 priority: 8, 16 17 // Return if this is a valid youtube feed. 18 valid: function(feed) { 19 feed = feed.replace(/(.*)\??(.*)/i, '$1'); 20 return feed.match(/\.xml$/i) !== null; 21 }, 22 23 // Returns the type of request to make. 24 getType: function(feed) { 25 return 'xml'; 26 }, 27 28 // Returns the feed provided the start and numItems. 29 getFeed: function(feed, start, numItems) { 30 return feed; 31 }, 32 33 // Parse the feed. 34 parse: function(data) { 35 var playlist = { 36 total_rows: 0, 37 nodes: [] 38 }; 39 jQuery('playlist trackList track', data).each(function(index) { 40 osmplayer.parser.rss.addRSSItem(playlist, jQuery(this)); 41 }); 42 return playlist; 43 } 44 }; 45