From d5c55f46685bab47781875877ade230c4a9c150f Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sat, 6 Apr 2019 08:48:48 +0900 Subject: [PATCH] =?utf8?q?=E5=BB=83=E6=AD=A2=E3=81=95=E3=82=8C=E3=81=9F=20?= =?utf8?q?twurl.nl=20=E3=81=AB=E3=82=88=E3=82=8BURL=E7=9F=AD=E7=B8=AE?= =?utf8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- OpenTween/MyCommon.cs | 2 +- OpenTween/Resources/ChangeLog.txt | 1 + OpenTween/ShortUrl.cs | 28 ---------------------------- OpenTween/Tween.Designer.cs | 9 --------- OpenTween/Tween.cs | 3 --- OpenTween/Tween.en.resx | 3 --- OpenTween/Tween.resx | 12 ------------ 7 files changed, 2 insertions(+), 56 deletions(-) diff --git a/OpenTween/MyCommon.cs b/OpenTween/MyCommon.cs index 8e9d7c81..4e053a4d 100644 --- a/OpenTween/MyCommon.cs +++ b/OpenTween/MyCommon.cs @@ -104,7 +104,6 @@ namespace OpenTween { TinyUrl, Isgd, - Twurl, Bitly, Jmp, Uxnu, @@ -112,6 +111,7 @@ namespace OpenTween Nicoms, //廃止 Unu = -1, + Twurl = -1, } public enum HITRESULT diff --git a/OpenTween/Resources/ChangeLog.txt b/OpenTween/Resources/ChangeLog.txt index db830d27..27422371 100644 --- a/OpenTween/Resources/ChangeLog.txt +++ b/OpenTween/Resources/ChangeLog.txt @@ -6,6 +6,7 @@ * CHG: Microsoft Translator Text API v3 に対応 - OpenTweenの古いバージョンの翻訳機能は 2019/4/30 以降に使用できなくなります * CHG: 廃止された短縮URLサービスのドメインをURL展開の対象から削除 + * CHG: 廃止された twurl.nl によるURL短縮機能を削除 * CHG: 廃止されたサービスのサムネイル表示対応を削除 * CHG: サービス終了したFavstarに関するメニュー項目を削除 diff --git a/OpenTween/ShortUrl.cs b/OpenTween/ShortUrl.cs index f3d65b5d..1a8255c2 100644 --- a/OpenTween/ShortUrl.cs +++ b/OpenTween/ShortUrl.cs @@ -311,9 +311,6 @@ namespace OpenTween case MyCommon.UrlConverter.Isgd: return await this.ShortenByIsgdAsync(srcUri) .ConfigureAwait(false); - case MyCommon.UrlConverter.Twurl: - return await this.ShortenByTwurlAsync(srcUri) - .ConfigureAwait(false); case MyCommon.UrlConverter.Bitly: return await this.ShortenByBitlyAsync(srcUri, "bit.ly") .ConfigureAwait(false); @@ -385,31 +382,6 @@ namespace OpenTween } } - private async Task ShortenByTwurlAsync(Uri srcUri) - { - // 明らかに長くなると推測できる場合は短縮しない - if ("http://twurl.nl/xxxxxx".Length > srcUri.OriginalString.Length) - return srcUri; - - var content = new FormUrlEncodedContent(new[] - { - new KeyValuePair("link[url]", srcUri.OriginalString), - }); - - using (var response = await this.http.PostAsync("http://tweetburner.com/links", content).ConfigureAwait(false)) - { - response.EnsureSuccessStatusCode(); - - var result = await response.Content.ReadAsStringAsync() - .ConfigureAwait(false); - - if (!Regex.IsMatch(result, @"^https?://")) - throw new WebApiException("Failed to create URL.", result); - - return new Uri(result.TrimEnd()); - } - } - private async Task ShortenByBitlyAsync(Uri srcUri, string domain = "bit.ly") { // 明らかに長くなると推測できる場合は短縮しない diff --git a/OpenTween/Tween.Designer.cs b/OpenTween/Tween.Designer.cs index 60b1277d..5bc0d809 100644 --- a/OpenTween/Tween.Designer.cs +++ b/OpenTween/Tween.Designer.cs @@ -150,7 +150,6 @@ this.UrlUndoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TinyURLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.IsgdToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.TwurlnlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.BitlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.JmpStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.UxnuMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -1304,7 +1303,6 @@ this.UrlUndoToolStripMenuItem, this.TinyURLToolStripMenuItem, this.IsgdToolStripMenuItem, - this.TwurlnlToolStripMenuItem, this.BitlyToolStripMenuItem, this.JmpStripMenuItem, this.UxnuMenuItem}); @@ -1335,12 +1333,6 @@ resources.ApplyResources(this.IsgdToolStripMenuItem, "IsgdToolStripMenuItem"); this.IsgdToolStripMenuItem.Click += new System.EventHandler(this.IsgdToolStripMenuItem_Click); // - // TwurlnlToolStripMenuItem - // - this.TwurlnlToolStripMenuItem.Name = "TwurlnlToolStripMenuItem"; - resources.ApplyResources(this.TwurlnlToolStripMenuItem, "TwurlnlToolStripMenuItem"); - this.TwurlnlToolStripMenuItem.Click += new System.EventHandler(this.TwurlnlToolStripMenuItem_Click); - // // BitlyToolStripMenuItem // this.BitlyToolStripMenuItem.Name = "BitlyToolStripMenuItem"; @@ -2299,7 +2291,6 @@ internal System.Windows.Forms.ToolStripMenuItem UrlUndoToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem TinyURLToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem IsgdToolStripMenuItem; - internal System.Windows.Forms.ToolStripMenuItem TwurlnlToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem BitlyToolStripMenuItem; internal System.Windows.Forms.ToolStripMenuItem UxnuMenuItem; internal System.Windows.Forms.ToolStripMenuItem UpdateFollowersMenuItem1; diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index 520b67e1..3b360c42 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -9274,9 +9274,6 @@ namespace OpenTween private async void IsgdToolStripMenuItem_Click(object sender, EventArgs e) => await this.UrlConvertAsync(MyCommon.UrlConverter.Isgd); - private async void TwurlnlToolStripMenuItem_Click(object sender, EventArgs e) - => await this.UrlConvertAsync(MyCommon.UrlConverter.Twurl); - private async void UxnuMenuItem_Click(object sender, EventArgs e) => await this.UrlConvertAsync(MyCommon.UrlConverter.Uxnu); diff --git a/OpenTween/Tween.en.resx b/OpenTween/Tween.en.resx index 5222638d..819f3d9b 100644 --- a/OpenTween/Tween.en.resx +++ b/OpenTween/Tween.en.resx @@ -830,9 +830,6 @@ 218, 24 - - 218, 24 - 218, 24 diff --git a/OpenTween/Tween.resx b/OpenTween/Tween.resx index fbfe8d0b..141eb848 100644 --- a/OpenTween/Tween.resx +++ b/OpenTween/Tween.resx @@ -1453,12 +1453,6 @@ is.gd - - 228, 22 - - - twurl.nl - 228, 22 @@ -3024,12 +3018,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - TwurlnlToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - BitlyToolStripMenuItem -- 2.11.0