開発に使用するリポジトリ
Revisión | 67a98161911259cd072898ba865bac35dcb2eba0 (tree) |
---|---|
Tiempo | 2012-12-22 01:02:03 |
Autor | Kimura Youichi <kim.upsilon@bucy...> |
Commiter | Kimura Youichi |
meta要素からのサムネイルURL取得用の正規表現を修正
@@ -33,7 +33,7 @@ namespace OpenTween.Thumbnail.Services | ||
33 | 33 | /// </summary> |
34 | 34 | class MetaThumbnailService : SimpleThumbnailService |
35 | 35 | { |
36 | - protected static Regex metaPattern = new Regex("<meta property=[\"'](?<property>.+?)[\"'] content=[\"'](?<content>.+?)[\"']"); | |
36 | + protected static Regex metaPattern = new Regex("<meta (name|property)=[\"'](?<name>.+?)[\"'] (content|value)=[\"'](?<content>.+?)[\"']"); | |
37 | 37 | protected static string[] propertyNames = { "twitter:image", "og:image" }; |
38 | 38 | |
39 | 39 | public MetaThumbnailService(string url) |
@@ -70,7 +70,7 @@ namespace OpenTween.Thumbnail.Services | ||
70 | 70 | |
71 | 71 | foreach (Match match in matches) |
72 | 72 | { |
73 | - var propertyName = match.Groups["property"].Value; | |
73 | + var propertyName = match.Groups["name"].Value; | |
74 | 74 | if (MetaThumbnailService.propertyNames.Contains(propertyName)) |
75 | 75 | { |
76 | 76 | return match.Groups["content"].Value; |