diff --git a/DailyDesktop.Core.Providers.Bing/BingProvider.cs b/DailyDesktop.Core.Providers.Bing/BingProvider.cs index 92e02c5..4c39d55 100644 --- a/DailyDesktop.Core.Providers.Bing/BingProvider.cs +++ b/DailyDesktop.Core.Providers.Bing/BingProvider.cs @@ -9,9 +9,7 @@ namespace DailyDesktop.Core.Providers.Bing { public class BingProvider : IProvider { - private const string RESOLUTION_PATTERN = "(?<=(_))([0-9x]*)(?=(\\.))"; - private const string RESOLUTION_REPLACEMENT = "1920x1080"; - private const string IMAGE_URI_PATTERN = "(?<=(]*?)1920x1080.[a-z]*"; private const string AUTHOR_PATTERN = "(?<=(
))(.*?)(?=(
))"; private const string TITLE_PATTERN = "(?<=(
))(.*?)(?=(
))"; private const string TITLE_URI_PATTERN = "(?<=(
))"; @@ -28,11 +26,10 @@ public WallpaperInfo GetWallpaperInfo() { pageHtml = client.DownloadString(SourceUri); } - Match imageRelativeUriMatch = Regex.Match(pageHtml, IMAGE_URI_PATTERN); + Match imageRelativeUriMatch = Regex.Match(pageHtml, IMAGE_RELATIVE_URI_PATTERN); string imageRelativeUri = imageRelativeUriMatch.Value; if (string.IsNullOrWhiteSpace(imageRelativeUri)) throw new ProviderException("Didn't find a relative image URI."); - imageRelativeUri = Regex.Replace(imageRelativeUri, RESOLUTION_PATTERN, RESOLUTION_REPLACEMENT); string imageUri = SourceUri + imageRelativeUri; Match authorMatch = Regex.Match(pageHtml, AUTHOR_PATTERN);