public MediaResult Transform(string Url) { var wc = new WebClient(); wc.UseDefaultProxy(); var sr = new StreamReader(wc.OpenRead(Url)); String lightbox = sr.ReadToEnd(); Match matchPicture = Regex.Match(lightbox, "background-image: url(\"\"http:\\/\\/([a-zA-Z0-9\\._\\'\\/\\-\\?\\=\\#\\&\\%]*)\""); if (matchPicture.Success) { return new MediaResult { MediaType = MediaType.Image, Provider = this, Url = "http://" + matchPicture.Groups[1].Value }; } return null; }
public MediaResult Transform(string Url) { var wc = new WebClient(); wc.UseDefaultProxy(); var sr = new StreamReader(wc.OpenRead(Url)); String imgur = sr.ReadToEnd(); Match matchPicture = Regex.Match(imgur, "<img alt=\"\" src=\"http:\\/\\/([a-zA-Z0-9\\._\\'\\/\\-\\?\\=\\#\\&\\%]*)\" original-title"); if (matchPicture.Success) { return new MediaResult { MediaType = MediaType.Image, Provider = this, Url = "http://" + matchPicture.Groups[1].Value }; } return null; }