using System;\r
using System.Xml;\r
using System.Text.RegularExpressions;\r
+using System.IO;\r
\r
namespace Handbrake.Functions\r
{\r
/// <summary>\r
/// Get the build information from the required appcasts. Run before accessing the public vars.\r
/// </summary>\r
- public void getInfo()\r
+ public void getInfo(string input)\r
{\r
// Get the correct Appcast and set input.\r
- XmlNode nodeItem = Properties.Settings.Default.hb_build.ToString().EndsWith("1") ? readRss(new XmlTextReader(Properties.Settings.Default.appcast_unstable)) : readRss(new XmlTextReader(Properties.Settings.Default.appcast));\r
- string input = nodeItem.InnerXml;\r
+ XmlNode nodeItem = readRss(new XmlTextReader(new StringReader(input)));\r
+ string result = nodeItem.InnerXml;\r
\r
// Regular Expressions\r
- Match ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
- Match verShort = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
+ Match ver = Regex.Match(result, @"sparkle:version=""([0-9]*)\""");\r
+ Match verShort = Regex.Match(result, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
\r
build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
version = verShort.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r