Home
> Uncategorized > Parsing Skylights Route information
Parsing Skylights Route information
A company which develops airline websites, known as SkyLights, has a common format for javascript which they place on their webpages to populate two dynamic drop down lists for their routes.
This can be parsed out of the page, using this c# code
// var aVCE = new Array(‘TXL’,’HAM’,’HAJ’,’CGN’,’STR’, 0);
string[] strlines = Regex.Split(tbEntry.Text,@"n"); string strOutput = ""; foreach(string strLine in strlines){
string strFromIata = Regex.Match(strLine,@"a(w{3})s").Groups[1].Value;MatchCollection mcIatas = Regex.Matches(strLine,@"’w{3}’");
foreach(Match mIata in mcIatas){
strOutput+="’" + strFromIata + "’," + mIata.Value + "rn";
}
}
tbEntry.Text = strOutput;
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback