+require 'cgi'
+
+class BliptvMediaFormat
+ # This is just a convenience class for parsing two parameters out of
+ # an RSS feed: 'url' and 'blip:role'.
+ def initialize(line)
+ @url = nil
+ @role = nil
+
+ url_regex = /url=\"([^\"]+)\"/
+ role_regex = /blip:role=\"([^\"]+)\"/
+ url_matches = url_regex.match(line)
+ role_matches = role_regex.match(line)
+
+ if not url_matches.nil? and (url_matches.length) > 1
+ @url = url_matches[1]
+ end
+
+ if not role_matches.nil? and (role_matches.length > 1)
+ @role = role_matches[1]
+ end
+ end
+
+ def role
+ return @role
+ end
+
+ def url
+ return @url
+ end
+end
+