開発に使用するリポジトリ
Revisión | cdb63e40b6a0a85cfbe9e9044b19572519509a15 (tree) |
---|---|
Tiempo | 2012-12-22 01:01:52 |
Autor | Kimura Youichi <kim.upsilon@bucy...> |
Commiter | Kimura Youichi |
OpenTween.Thumbnail.Services.* のテストをいくつか追加
@@ -8,7 +8,7 @@ | ||
8 | 8 | <ProjectGuid>{18A32642-A8F3-425B-978D-0C6F630EDDE8}</ProjectGuid> |
9 | 9 | <OutputType>Library</OutputType> |
10 | 10 | <AppDesignerFolder>Properties</AppDesignerFolder> |
11 | - <RootNamespace>OpenTween.Tests</RootNamespace> | |
11 | + <RootNamespace>OpenTween</RootNamespace> | |
12 | 12 | <AssemblyName>OpenTween.Tests</AssemblyName> |
13 | 13 | <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
14 | 14 | <FileAlignment>512</FileAlignment> |
@@ -58,6 +58,10 @@ | ||
58 | 58 | <Compile Include="Properties\AssemblyInfo.cs" /> |
59 | 59 | <Compile Include="TabsDialogTest.cs" /> |
60 | 60 | <Compile Include="TestUtils.cs" /> |
61 | + <Compile Include="Thumbnail\Services\ImgAzyobuziNetTest.cs" /> | |
62 | + <Compile Include="Thumbnail\Services\MetaThumbnailServiceTest.cs" /> | |
63 | + <Compile Include="Thumbnail\Services\SimpleThumbnailServiceTest.cs" /> | |
64 | + <Compile Include="Thumbnail\Services\TinamiTest.cs" /> | |
61 | 65 | </ItemGroup> |
62 | 66 | <ItemGroup> |
63 | 67 | <ProjectReference Include="..\OpenTween\OpenTween.csproj"> |
@@ -0,0 +1,62 @@ | ||
1 | +// OpenTween - Client of Twitter | |
2 | +// Copyright (c) 2012 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/> | |
3 | +// All rights reserved. | |
4 | +// | |
5 | +// This file is part of OpenTween. | |
6 | +// | |
7 | +// This program is free software; you can redistribute it and/or modify it | |
8 | +// under the terms of the GNU General Public License as published by the Free | |
9 | +// Software Foundation; either version 3 of the License, or (at your option) | |
10 | +// any later version. | |
11 | +// | |
12 | +// This program is distributed in the hope that it will be useful, but | |
13 | +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | +// for more details. | |
16 | +// | |
17 | +// You should have received a copy of the GNU General Public License along | |
18 | +// with this program. If not, see <http://www.gnu.org/licenses/>, or write to | |
19 | +// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
20 | +// Boston, MA 02110-1301, USA. | |
21 | + | |
22 | +using System; | |
23 | +using System.Collections.Generic; | |
24 | +using System.Linq; | |
25 | +using System.Text; | |
26 | +using NUnit.Framework; | |
27 | + | |
28 | +namespace OpenTween.Thumbnail.Services | |
29 | +{ | |
30 | + [TestFixture] | |
31 | + class ImgAzyobuziNetTest | |
32 | + { | |
33 | + class TestImgAzyobuziNet : ImgAzyobuziNet | |
34 | + { | |
35 | + protected override byte[] FetchRegex(string apiBase) | |
36 | + { | |
37 | + return Encoding.UTF8.GetBytes("[{\"name\": \"hogehoge\", \"regex\": \"^https?://example.com/(.+)$\"}]"); | |
38 | + } | |
39 | + } | |
40 | + | |
41 | + [Test] | |
42 | + public void MatchTest() | |
43 | + { | |
44 | + var service = new TestImgAzyobuziNet(); | |
45 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
46 | + | |
47 | + Assert.That(thumbinfo, Is.Not.Null); | |
48 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://example.com/abcd")); | |
49 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.azyobuzi.net/api/redirect?uri=http%3A%2F%2Fexample.com%2Fabcd")); | |
50 | + Assert.That(thumbinfo.TooltipText, Is.Null); | |
51 | + } | |
52 | + | |
53 | + [Test] | |
54 | + public void NotMatchTest() | |
55 | + { | |
56 | + var service = new TestImgAzyobuziNet(); | |
57 | + var thumbinfo = service.GetThumbnailInfo("http://hogehoge.com/abcd", null); | |
58 | + | |
59 | + Assert.That(thumbinfo, Is.Null); | |
60 | + } | |
61 | + } | |
62 | +} |
@@ -0,0 +1,139 @@ | ||
1 | +// OpenTween - Client of Twitter | |
2 | +// Copyright (c) 2012 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/> | |
3 | +// All rights reserved. | |
4 | +// | |
5 | +// This file is part of OpenTween. | |
6 | +// | |
7 | +// This program is free software; you can redistribute it and/or modify it | |
8 | +// under the terms of the GNU General Public License as published by the Free | |
9 | +// Software Foundation; either version 3 of the License, or (at your option) | |
10 | +// any later version. | |
11 | +// | |
12 | +// This program is distributed in the hope that it will be useful, but | |
13 | +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | +// for more details. | |
16 | +// | |
17 | +// You should have received a copy of the GNU General Public License along | |
18 | +// with this program. If not, see <http://www.gnu.org/licenses/>, or write to | |
19 | +// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
20 | +// Boston, MA 02110-1301, USA. | |
21 | + | |
22 | +using System; | |
23 | +using System.Collections.Generic; | |
24 | +using System.Linq; | |
25 | +using System.Text; | |
26 | +using NUnit.Framework; | |
27 | + | |
28 | +namespace OpenTween.Thumbnail.Services | |
29 | +{ | |
30 | + [TestFixture] | |
31 | + class MetaThumbnailServiceTest | |
32 | + { | |
33 | + class TestMetaThumbnailService : MetaThumbnailService | |
34 | + { | |
35 | + public string FakeHtml { get; set; } | |
36 | + | |
37 | + public TestMetaThumbnailService(string url) | |
38 | + : base(url) | |
39 | + { | |
40 | + } | |
41 | + | |
42 | + protected override string FetchImageUrl(string url) | |
43 | + { | |
44 | + return this.FakeHtml; | |
45 | + } | |
46 | + } | |
47 | + | |
48 | + [Test] | |
49 | + [Description("Open Graph protocol")] | |
50 | + public void OGPMetaTest() | |
51 | + { | |
52 | + var service = new TestMetaThumbnailService(@"http://example.com/.+"); | |
53 | + | |
54 | + service.FakeHtml = @" | |
55 | +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> | |
56 | +<html xmlns='http://www.w3.org/1999/xhtml'> | |
57 | +<head> | |
58 | + <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> | |
59 | + <meta property='og:image' content='http://img.example.com/abcd'/> | |
60 | + <title>hogehoge</title> | |
61 | +</head> | |
62 | +<body> | |
63 | + <p>hogehoge</p> | |
64 | +</body> | |
65 | +</html> | |
66 | +"; | |
67 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
68 | + | |
69 | + Assert.That(thumbinfo, Is.Not.Null); | |
70 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://example.com/abcd")); | |
71 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.example.com/abcd")); | |
72 | + Assert.That(thumbinfo.TooltipText, Is.Null); | |
73 | + } | |
74 | + | |
75 | + [Test] | |
76 | + [Description("Twitter Cards")] | |
77 | + public void TwitterMetaTest() | |
78 | + { | |
79 | + var service = new TestMetaThumbnailService(@"http://example.com/.+"); | |
80 | + | |
81 | + service.FakeHtml = @" | |
82 | +<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> | |
83 | + | |
84 | +<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> | |
85 | +<meta name='twitter:image' content='http://img.example.com/abcd'> | |
86 | +<title>hogehoge</title> | |
87 | + | |
88 | +<p>hogehoge | |
89 | +"; | |
90 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
91 | + | |
92 | + Assert.That(thumbinfo, Is.Not.Null); | |
93 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://example.com/abcd")); | |
94 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.example.com/abcd")); | |
95 | + Assert.That(thumbinfo.TooltipText, Is.Null); | |
96 | + } | |
97 | + | |
98 | + [Test] | |
99 | + [Description("Twitpicとか")] | |
100 | + public void InvalidMetaTest() | |
101 | + { | |
102 | + var service = new TestMetaThumbnailService(@"http://example.com/.+"); | |
103 | + | |
104 | + service.FakeHtml = @" | |
105 | +<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> | |
106 | + | |
107 | +<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> | |
108 | +<meta name='twitter:image' value='http://img.example.com/abcd'> | |
109 | +<title>hogehoge</title> | |
110 | + | |
111 | +<p>hogehoge | |
112 | +"; | |
113 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
114 | + | |
115 | + Assert.That(thumbinfo, Is.Not.Null); | |
116 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://example.com/abcd")); | |
117 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.example.com/abcd")); | |
118 | + Assert.That(thumbinfo.TooltipText, Is.Null); | |
119 | + } | |
120 | + | |
121 | + [Test] | |
122 | + public void NoMetaTest() | |
123 | + { | |
124 | + var service = new TestMetaThumbnailService(@"http://example.com/.+"); | |
125 | + | |
126 | + service.FakeHtml = @" | |
127 | +<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> | |
128 | + | |
129 | +<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> | |
130 | +<title>hogehoge</title> | |
131 | + | |
132 | +<p>hogehoge | |
133 | +"; | |
134 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
135 | + | |
136 | + Assert.That(thumbinfo, Is.Null); | |
137 | + } | |
138 | + } | |
139 | +} |
@@ -0,0 +1,56 @@ | ||
1 | +// OpenTween - Client of Twitter | |
2 | +// Copyright (c) 2012 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/> | |
3 | +// All rights reserved. | |
4 | +// | |
5 | +// This file is part of OpenTween. | |
6 | +// | |
7 | +// This program is free software; you can redistribute it and/or modify it | |
8 | +// under the terms of the GNU General Public License as published by the Free | |
9 | +// Software Foundation; either version 3 of the License, or (at your option) | |
10 | +// any later version. | |
11 | +// | |
12 | +// This program is distributed in the hope that it will be useful, but | |
13 | +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | +// for more details. | |
16 | +// | |
17 | +// You should have received a copy of the GNU General Public License along | |
18 | +// with this program. If not, see <http://www.gnu.org/licenses/>, or write to | |
19 | +// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
20 | +// Boston, MA 02110-1301, USA. | |
21 | + | |
22 | +using System; | |
23 | +using System.Collections.Generic; | |
24 | +using System.Linq; | |
25 | +using System.Text; | |
26 | +using NUnit.Framework; | |
27 | + | |
28 | +namespace OpenTween.Thumbnail.Services | |
29 | +{ | |
30 | + [TestFixture] | |
31 | + class SimpleThumbnailServiceTest | |
32 | + { | |
33 | + [Test] | |
34 | + public void RegexMatchTest() | |
35 | + { | |
36 | + var service = new SimpleThumbnailService(@"http://example.com/(.+)", @"http://img.example.com/$1"); | |
37 | + | |
38 | + var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null); | |
39 | + | |
40 | + Assert.That(thumbinfo, Is.Not.Null); | |
41 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://example.com/abcd")); | |
42 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.example.com/abcd")); | |
43 | + Assert.That(thumbinfo.TooltipText, Is.Null); | |
44 | + } | |
45 | + | |
46 | + [Test] | |
47 | + public void RegexNotMatchTest() | |
48 | + { | |
49 | + var service = new SimpleThumbnailService(@"http://example.com/(.+)", @"http://img.example.com/\1"); | |
50 | + | |
51 | + var thumbinfo = service.GetThumbnailInfo("http://hogehoge.com/abcd", null); | |
52 | + | |
53 | + Assert.That(thumbinfo, Is.Null); | |
54 | + } | |
55 | + } | |
56 | +} |
@@ -0,0 +1,59 @@ | ||
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Text; | |
5 | +using NUnit.Framework; | |
6 | +using System.Xml.Linq; | |
7 | + | |
8 | +namespace OpenTween.Thumbnail.Services | |
9 | +{ | |
10 | + [TestFixture] | |
11 | + class TinamiTest | |
12 | + { | |
13 | + class TestTinami : Tinami | |
14 | + { | |
15 | + public string FakeXml { get; set; } | |
16 | + | |
17 | + public TestTinami(string pattern, string replacement) | |
18 | + : base(pattern, replacement) | |
19 | + { | |
20 | + } | |
21 | + | |
22 | + protected override XDocument FetchContentInfoApi(string url) | |
23 | + { | |
24 | + Assert.That(url, Is.StringMatching(@"http://api\.tinami\.com/content/info\?cont_id=.+&api_key=.+")); | |
25 | + | |
26 | + return XDocument.Parse(this.FakeXml); | |
27 | + } | |
28 | + } | |
29 | + | |
30 | + [Test] | |
31 | + public void ApiTest() | |
32 | + { | |
33 | + var service = new TestTinami(@"^http://www\.tinami\.com/view/(?<ContentId>\d+)$", | |
34 | + "http://api.tinami.com/content/info?cont_id=${ContentId}&api_key=" + ApplicationSettings.TINAMIApiKey); | |
35 | + | |
36 | + service.FakeXml = @"<?xml version='1.0' encoding='utf-8' ?> | |
37 | +<rsp stat='ok'> | |
38 | + <content type='illust' issupport='1' iscollection='0'> | |
39 | + <title>ほげほげ</title> | |
40 | + <description>説明</description> | |
41 | + <thumbnails> | |
42 | + <thumbnail_150x150 url='http://img.tinami.com/hogehoge_150.gif' width='112' height='120'/> | |
43 | + </thumbnails> | |
44 | + <image> | |
45 | + <url>http://img.tinami.com/hogehoge_full.gif</url> | |
46 | + <width>640</width> | |
47 | + <height>480</height> | |
48 | + </image> | |
49 | + </content> | |
50 | +</rsp>"; | |
51 | + var thumbinfo = service.GetThumbnailInfo("http://www.tinami.com/view/12345", null); | |
52 | + | |
53 | + Assert.That(thumbinfo, Is.Not.Null); | |
54 | + Assert.That(thumbinfo.ImageUrl, Is.EqualTo("http://www.tinami.com/view/12345")); | |
55 | + Assert.That(thumbinfo.ThumbnailUrl, Is.EqualTo("http://img.tinami.com/hogehoge_150.gif")); | |
56 | + Assert.That(thumbinfo.TooltipText, Is.EqualTo("説明")); | |
57 | + } | |
58 | + } | |
59 | +} |
@@ -44,10 +44,16 @@ namespace OpenTween.Thumbnail.Services | ||
44 | 44 | |
45 | 45 | private object LockObj = new object(); |
46 | 46 | |
47 | - public ImgAzyobuziNet() | |
47 | + public ImgAzyobuziNet(bool autoupdate = false) | |
48 | 48 | { |
49 | 49 | this.LoadRegex(); |
50 | 50 | |
51 | + if (autoupdate) | |
52 | + this.StartAutoUpdate(); | |
53 | + } | |
54 | + | |
55 | + public void StartAutoUpdate() | |
56 | + { | |
51 | 57 | Task.Factory.StartNew(() => |
52 | 58 | { |
53 | 59 | for (;;) |
@@ -80,8 +86,7 @@ namespace OpenTween.Thumbnail.Services | ||
80 | 86 | { |
81 | 87 | try |
82 | 88 | { |
83 | - using (var client = new OTWebClient() { Timeout = 1000 }) | |
84 | - using (var jsonReader = JsonReaderWriterFactory.CreateJsonReader(client.DownloadData(apiBase + "regex.json"), XmlDictionaryReaderQuotas.Max)) | |
89 | + using (var jsonReader = JsonReaderWriterFactory.CreateJsonReader(this.FetchRegex(apiBase), XmlDictionaryReaderQuotas.Max)) | |
85 | 90 | { |
86 | 91 | var xElm = XElement.Load(jsonReader); |
87 | 92 |
@@ -102,6 +107,14 @@ namespace OpenTween.Thumbnail.Services | ||
102 | 107 | return false; |
103 | 108 | } |
104 | 109 | |
110 | + protected virtual byte[] FetchRegex(string apiBase) | |
111 | + { | |
112 | + using (var client = new OTWebClient() { Timeout = 1000 }) | |
113 | + { | |
114 | + return client.DownloadData(apiBase + "regex.json"); | |
115 | + } | |
116 | + } | |
117 | + | |
105 | 118 | public override ThumbnailInfo GetThumbnailInfo(string url, PostClass post) |
106 | 119 | { |
107 | 120 | lock (this.LockObj) |
@@ -36,7 +36,12 @@ namespace OpenTween.Thumbnail.Services | ||
36 | 36 | protected static Regex metaPattern = new Regex("<meta property=[\"'](?<property>.+?)[\"'] content=[\"'](?<content>.+?)[\"']"); |
37 | 37 | protected static string[] propertyNames = { "twitter:image", "og:image" }; |
38 | 38 | |
39 | - public MetaThumbnailService(string pattern, string replacement = "${0}") | |
39 | + public MetaThumbnailService(string url) | |
40 | + : base(url, "${0}") | |
41 | + { | |
42 | + } | |
43 | + | |
44 | + public MetaThumbnailService(string pattern, string replacement) | |
40 | 45 | : base(pattern, replacement) |
41 | 46 | { |
42 | 47 | } |
@@ -46,7 +51,9 @@ namespace OpenTween.Thumbnail.Services | ||
46 | 51 | var pageUrl = this.ReplaceUrl(url); |
47 | 52 | if (pageUrl == null) return null; |
48 | 53 | |
49 | - var thumbnailUrl = this.FetchThumbnailUrl(pageUrl); | |
54 | + var content = this.FetchImageUrl(pageUrl); | |
55 | + | |
56 | + var thumbnailUrl = this.GetThumbnailUrl(content); | |
50 | 57 | if (string.IsNullOrEmpty(thumbnailUrl)) return null; |
51 | 58 | |
52 | 59 | return new ThumbnailInfo() |
@@ -57,23 +64,27 @@ namespace OpenTween.Thumbnail.Services | ||
57 | 64 | }; |
58 | 65 | } |
59 | 66 | |
60 | - protected virtual string FetchThumbnailUrl(string url) | |
67 | + protected virtual string GetThumbnailUrl(string html) | |
61 | 68 | { |
62 | - using (var client = new OTWebClient()) | |
63 | - { | |
64 | - var content = client.DownloadString(url); | |
65 | - var matches = MetaThumbnailService.metaPattern.Matches(content); | |
69 | + var matches = MetaThumbnailService.metaPattern.Matches(html); | |
66 | 70 | |
67 | - foreach (Match match in matches) | |
71 | + foreach (Match match in matches) | |
72 | + { | |
73 | + var propertyName = match.Groups["property"].Value; | |
74 | + if (MetaThumbnailService.propertyNames.Contains(propertyName)) | |
68 | 75 | { |
69 | - var propertyName = match.Groups["property"].Value; | |
70 | - if (MetaThumbnailService.propertyNames.Contains(propertyName)) | |
71 | - { | |
72 | - return match.Groups["content"].Value; | |
73 | - } | |
76 | + return match.Groups["content"].Value; | |
74 | 77 | } |
78 | + } | |
79 | + | |
80 | + return null; | |
81 | + } | |
75 | 82 | |
76 | - return null; | |
83 | + protected virtual string FetchImageUrl(string url) | |
84 | + { | |
85 | + using (var client = new OTWebClient()) | |
86 | + { | |
87 | + return client.DownloadString(url); | |
77 | 88 | } |
78 | 89 | } |
79 | 90 | } |
@@ -34,9 +34,9 @@ namespace OpenTween.Thumbnail.Services | ||
34 | 34 | { |
35 | 35 | } |
36 | 36 | |
37 | - protected override string FetchThumbnailUrl(string url) | |
37 | + protected override string FetchImageUrl(string url) | |
38 | 38 | { |
39 | - var thumbnailUrl = base.FetchThumbnailUrl(url); | |
39 | + var thumbnailUrl = base.FetchImageUrl(url); | |
40 | 40 | |
41 | 41 | // og:image のサムネイルURLにそのままアクセスすると403が返ってくるので回避 |
42 | 42 | return Regex.Replace(thumbnailUrl, @"_s(?=\..{3}$)", "_m"); |
@@ -28,7 +28,7 @@ using System.Text.RegularExpressions; | ||
28 | 28 | namespace OpenTween.Thumbnail.Services |
29 | 29 | { |
30 | 30 | /// <summary> |
31 | - /// 正規表現による単純な置換でサムネイルURLを生成する | |
31 | + /// 正規表現によるURLの単純な置換でサムネイルURLを生成する | |
32 | 32 | /// </summary> |
33 | 33 | class SimpleThumbnailService : IThumbnailService |
34 | 34 | { |
@@ -43,7 +43,7 @@ namespace OpenTween.Thumbnail.Services | ||
43 | 43 | var apiUrl = base.ReplaceUrl(url); |
44 | 44 | if (apiUrl == null) return null; |
45 | 45 | |
46 | - var xdoc = XDocument.Load(apiUrl); | |
46 | + var xdoc = this.FetchContentInfoApi(apiUrl); | |
47 | 47 | |
48 | 48 | if (xdoc.XPathSelectElement("/rsp").Attribute("stat").Value == "ok") |
49 | 49 | { |
@@ -63,5 +63,10 @@ namespace OpenTween.Thumbnail.Services | ||
63 | 63 | |
64 | 64 | return null; |
65 | 65 | } |
66 | + | |
67 | + protected virtual XDocument FetchContentInfoApi(string url) | |
68 | + { | |
69 | + return XDocument.Load(url); | |
70 | + } | |
66 | 71 | } |
67 | 72 | } |
@@ -40,7 +40,7 @@ namespace OpenTween.Thumbnail | ||
40 | 40 | new SimpleThumbnailService(@"^https?://.*(\.jpg|\.jpeg|\.gif|\.png|\.bmp)$", "${0}"), |
41 | 41 | |
42 | 42 | // img.azyobuzi.net |
43 | - new ImgAzyobuziNet(), | |
43 | + new ImgAzyobuziNet(autoupdate: true), | |
44 | 44 | |
45 | 45 | // ImgUr |
46 | 46 | new SimpleThumbnailService(@"^http://(?:i\.)?imgur\.com/(\w+)(?:\..{3})?$", "http://img.imgur.com/${1}l.jpg"), |