• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OpenTweenのfork


Commit MetaInfo

修订版328d287878d1bf44011cd2bc092ebd14cd9add06 (tree)
时间2012-02-18 23:10:27
作者kiri_feather <kiri_feather@user...>
CommiterKimura Youichi

Log Message

0790リリース。Webモードで公式RT発言が取得できない問題に対応

git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@17 e39ad16e-3079-482e-bb30-4b4d378143b6

更改概述

差异

--- a/Tween/My Project/AssemblyInfo.vb
+++ b/Tween/My Project/AssemblyInfo.vb
@@ -55,5 +55,5 @@ Imports System.Runtime.InteropServices
5555 ' <Assembly: AssemblyVersion("1.0.*")>
5656
5757 <Assembly: AssemblyVersion("0.7.*")>
58-<Assembly: AssemblyFileVersion("0.7.8.0")>
58+<Assembly: AssemblyFileVersion("0.7.9.0")>
5959
--- a/Tween/Resources/ChangeLog.txt
+++ b/Tween/Resources/ChangeLog.txt
@@ -1,7 +1,10 @@
11 更新履歴
22
3-==== Ver 0.7.9.0(Unreleased)
3+==== Ver 0.8.0.0(Unreleased)
4+ * Webモードで公式RT発言をコピー、開くした時にユーザーと発言IDが不整合になっていた問題に対応
5+==== Ver 0.7.9.0(2009/11/19)
46 * APIモードでのハッシュタグ誤認対応
7+ * Webモードで公式RT発言が取得できない問題に対応。マーク欄に「RT」、発言詳細の発言者の後ろにRTしたユーザーを表示。基本はRT元発言を表示します。(APIモードは変更なし)
58 ==== Ver 0.7.8.0(2009/11/18)
69 * Webモードで、公式ReTweetが有効になっている場合に、RT発言をFav発言と誤認する問題に対応
710 ==== Ver 0.7.7.0(2009/11/15)
--- a/Tween/StatusDictionary.vb
+++ b/Tween/StatusDictionary.vb
@@ -51,6 +51,7 @@ Public NotInheritable Class PostClass
5151 Private _statuses As Statuses = Statuses.None
5252 Private _Uid As Long
5353 Private _FilterHit As Boolean
54+ Private _RetweetedBy As String
5455
5556 <FlagsAttribute()> _
5657 Private Enum Statuses
@@ -82,7 +83,8 @@ Public NotInheritable Class PostClass
8283 ByVal ImageIndex As Integer, _
8384 ByVal IsDm As Boolean, _
8485 ByVal Uid As Long, _
85- ByVal FilterHit As Boolean)
86+ ByVal FilterHit As Boolean, _
87+ ByVal RetweetedBy As String)
8688 _Nick = Nickname
8789 _Data = Data
8890 _ImageUrl = ImageUrl
@@ -105,6 +107,7 @@ Public NotInheritable Class PostClass
105107 _IsDm = IsDm
106108 _Uid = Uid
107109 _FilterHit = FilterHit
110+ _RetweetedBy = RetweetedBy
108111 End Sub
109112
110113 Public Sub New()
@@ -306,6 +309,14 @@ Public NotInheritable Class PostClass
306309 _FilterHit = value
307310 End Set
308311 End Property
312+ Public Property RetweetedBy() As String
313+ Get
314+ Return _RetweetedBy
315+ End Get
316+ Set(ByVal value As String)
317+ _RetweetedBy = value
318+ End Set
319+ End Property
309320 End Class
310321
311322 Public NotInheritable Class TabInformations
--- a/Tween/Tween.vb
+++ b/Tween/Tween.vb
@@ -3279,6 +3279,7 @@ Public Class TweenMain
32793279 If Post.IsMark Then mk += "♪"
32803280 If Post.IsProtect Then mk += "Ю"
32813281 If Post.InReplyToId > 0 Then mk += "⇒"
3282+ If Not String.IsNullOrEmpty(Post.RetweetedBy) Then mk += "RT"
32823283 Dim sitem() As String = {"", Post.Nickname, Post.Data, Post.PDate.ToString(SettingDialog.DateTimeFormat), Post.Name, "", mk, Post.Source}
32833284 Dim itm As ListViewItem = New ListViewItem(sitem, Post.ImageIndex)
32843285 Dim read As Boolean = Post.IsRead
@@ -3614,7 +3615,11 @@ RETRY:
36143615 Private Sub StatusOpenMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusOpenMenuItem.Click
36153616 If _curList.SelectedIndices.Count > 0 AndAlso _statuses.Tabs(_curTab.Text).TabType <> TabUsageType.DirectMessage Then
36163617 Dim post As PostClass = _statuses.Item(_curTab.Text, _curList.SelectedIndices(0))
3617- OpenUriAsync("http://twitter.com/" + post.Name + "/status/" + post.Id.ToString)
3618+ If String.IsNullOrEmpty(post.RetweetedBy) Then
3619+ OpenUriAsync("http://twitter.com/" + post.Name + "/status/" + post.Id.ToString)
3620+ Else
3621+ OpenUriAsync("http://twitter.com/" + post.RetweetedBy + "/status/" + post.Id.ToString)
3622+ End If
36183623 End If
36193624 End Sub
36203625
@@ -3756,6 +3761,9 @@ RETRY:
37563761 NameLabel.Text = ""
37573762 End If
37583763 NameLabel.Text += _curPost.Name + "/" + _curPost.Nickname
3764+ If Not String.IsNullOrEmpty(_curPost.RetweetedBy) Then
3765+ NameLabel.Text += " (RT:" + _curPost.RetweetedBy + ")"
3766+ End If
37593767 'If UserPicture.Image IsNot Nothing Then UserPicture.Image.Dispose()
37603768 If _curPost.ImageIndex > -1 Then
37613769 UserPicture.Image = TIconDic(_curPost.ImageUrl)
@@ -4005,7 +4013,11 @@ RETRY:
40054013 For Each idx As Integer In _curList.SelectedIndices
40064014 Dim post As PostClass = _statuses.Item(_curTab.Text, idx)
40074015 If post.IsProtect AndAlso SettingDialog.ProtectNotInclude Then Continue For
4008- sb.AppendFormat("{0}:{1} [http://twitter.com/{0}/status/{2}]{3}", post.Name, post.Data, post.Id, Environment.NewLine)
4016+ If String.IsNullOrEmpty(post.RetweetedBy) Then
4017+ sb.AppendFormat("{0}:{1} [http://twitter.com/{0}/status/{2}]{3}", post.Name, post.Data, post.Id, Environment.NewLine)
4018+ Else
4019+ sb.AppendFormat("{0}:{1} [http://twitter.com/{2}/status/{3}]{4}", post.Name, post.Data, post.RetweetedBy, post.Id, Environment.NewLine)
4020+ End If
40094021 Next
40104022 If sb.Length > 0 Then
40114023 clstr = sb.ToString()
@@ -4018,7 +4030,11 @@ RETRY:
40184030 Dim sb As New StringBuilder()
40194031 For Each idx As Integer In _curList.SelectedIndices
40204032 Dim post As PostClass = _statuses.Item(_curTab.Text, idx)
4021- sb.AppendFormat("http://twitter.com/{0}/status/{1}{2}", post.Name, post.Id, Environment.NewLine)
4033+ If String.IsNullOrEmpty(post.RetweetedBy) Then
4034+ sb.AppendFormat("http://twitter.com/{0}/status/{1}{2}", post.Name, post.Id, Environment.NewLine)
4035+ Else
4036+ sb.AppendFormat("http://twitter.com/{0}/status/{1}{2}", post.RetweetedBy, post.Id, Environment.NewLine)
4037+ End If
40224038 Next
40234039 If sb.Length > 0 Then
40244040 clstr = sb.ToString()
--- a/Tween/Twitter.vb
+++ b/Tween/Twitter.vb
@@ -324,7 +324,7 @@ Public Module Twitter
324324 End If
325325
326326 ' tr 要素の class 属性を消去
327- retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls> class=""[^""]+"")", "${tagStart}")
327+ retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls>\s+class=""[^""]+"")", "${tagStart}")
328328 'Do
329329 ' Try
330330 ' Dim idx As Integer = retMsg.IndexOf(_removeClass, StringComparison.Ordinal)
@@ -368,6 +368,8 @@ Public Module Twitter
368368 Dim dlgt(20) As GetIconImageDelegate
369369 Dim ar(20) As IAsyncResult
370370 Dim arIdx As Integer = -1
371+ Dim rg As Regex
372+ Dim m As Match
371373
372374 For Each strPost As String In posts
373375 intCnt += 1
@@ -486,6 +488,17 @@ Public Module Twitter
486488 post.IsProtect = True
487489 End If
488490
491+ 'RetweetedBy
492+ If strPost.IndexOf("class=""big-retweet-icon""") > -1 Then
493+ rg = New Regex("class=""shared-content"".+<a href=""/(?<name>[a-zA-Z0-9_]+)""")
494+ m = rg.Match(strPost)
495+ If m.Success Then
496+ post.RetweetedBy = m.Result("${name}")
497+ Else
498+ post.RetweetedBy = ""
499+ End If
500+ End If
501+
489502 'Get Message
490503 pos1 = strPost.IndexOf(_parseMsg1, pos2, StringComparison.Ordinal)
491504 If pos1 < 0 Then
@@ -581,8 +594,8 @@ Public Module Twitter
581594
582595 'from Sourceの取得
583596 'ToDo: _parseSourceFromを正規表現へ。wedataからの取得へ変更(次版より)
584- Dim rg As New Regex("<span>.+>(?<name>.+)</a>.*</span>")
585- Dim m As Match = rg.Match(strPost)
597+ rg = New Regex("<span>.+>(?<name>.+)</a>.*</span>")
598+ m = rg.Match(strPost)
586599 If m.Success Then
587600 post.Source = m.Result("${name}")
588601 Else
@@ -649,7 +662,6 @@ Public Module Twitter
649662 ' post.IsFav = False
650663 'End If
651664
652-
653665 If _endingFlag Then Return ""
654666
655667 post.IsMe = post.Name.Equals(_uid, StringComparison.OrdinalIgnoreCase)
@@ -803,7 +815,7 @@ Public Module Twitter
803815 End If
804816
805817 ' tr 要素の class 属性を消去
806- retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls> class=""[^""]+"")", "${tagStart}")
818+ retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls>\s+class=""[^""]+"")", "${tagStart}")
807819 'Do
808820 ' Try
809821 ' Dim idx As Integer = retMsg.IndexOf(_removeClass, StringComparison.Ordinal)
@@ -1058,7 +1070,7 @@ Public Module Twitter
10581070 End If
10591071
10601072 ' tr 要素の class 属性を消去
1061- retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls> class=""[^""]+"")", "${tagStart}")
1073+ retMsg = Regex.Replace(retMsg, "(?<tagStart><li)(?<cls>\s+class=""[^""]+"")", "${tagStart}")
10621074 'Do
10631075 ' Try
10641076 ' Dim idx As Integer = retMsg.IndexOf(_removeClass, StringComparison.Ordinal)
@@ -1098,6 +1110,8 @@ Public Module Twitter
10981110 Dim dlgt(20) As GetIconImageDelegate
10991111 Dim ar(20) As IAsyncResult
11001112 Dim arIdx As Integer = -1
1113+ Dim rg As Regex
1114+ Dim m As Match
11011115
11021116 For Each strPost As String In posts
11031117 intCnt += 1
@@ -1180,6 +1194,17 @@ Public Module Twitter
11801194 post.IsProtect = True
11811195 End If
11821196
1197+ 'RetweetedBy
1198+ If strPost.IndexOf("class=""big-retweet-icon""") > -1 Then
1199+ rg = New Regex("class=""shared-content"".+<a href=""/(?<name>[a-zA-Z0-9_]+)""")
1200+ m = rg.Match(strPost)
1201+ If m.Success Then
1202+ post.RetweetedBy = m.Result("${name}")
1203+ Else
1204+ post.RetweetedBy = ""
1205+ End If
1206+ End If
1207+
11831208 'Get Message
11841209 pos1 = strPost.IndexOf(_parseMsg1, pos2, StringComparison.Ordinal)
11851210 If pos1 < 0 Then
@@ -1275,8 +1300,8 @@ Public Module Twitter
12751300
12761301 'from Sourceの取得
12771302 'ToDo: _parseSourceFromを正規表現へ。wedataからの取得へ変更(次版より)
1278- Dim rg As New Regex("<span>.+>(?<name>.+)</a>.*</span>")
1279- Dim m As Match = rg.Match(strPost)
1303+ rg = New Regex("<span>.+>(?<name>.+)</a>.*</span>")
1304+ m = rg.Match(strPost)
12801305 If m.Success Then
12811306 post.Source = m.Result("${name}")
12821307 Else