svnno****@sourc*****
svnno****@sourc*****
2010年 11月 24日 (水) 23:01:41 JST
Revision: 1109 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1109 Author: syo68k Date: 2010-11-24 23:01:41 +0900 (Wed, 24 Nov 2010) Log Message: ----------- 受信スレッドでイベントをパースするように。まだ処理の実体は全く書いていない Modified Paths: -------------- branches/UserStream/Tween/Twitter.vb -------------- next part -------------- Modified: branches/UserStream/Tween/Twitter.vb =================================================================== --- branches/UserStream/Tween/Twitter.vb 2010-11-24 12:45:31 UTC (rev 1108) +++ branches/UserStream/Tween/Twitter.vb 2010-11-24 14:01:41 UTC (rev 1109) @@ -2779,6 +2779,11 @@ End If End Sub + Private EventNameTable() As String = { _ + "friends", _ + "target" + } + Private Sub UserStreamLoop() Dim st As Stream = Nothing Dim sr As StreamReader = Nothing @@ -2792,6 +2797,25 @@ Do While _streamActive Dim line As String = sr.ReadLine() If _streamBypass OrElse String.IsNullOrEmpty(line) Then Continue Do + + Dim idx As Integer = line.IndexOf("{""") + Dim idx2 As Integer = line.IndexOf(""":") + If idx = 0 AndAlso idx2 > 0 Then + Dim eventname As String = line.Substring(idx + 2, idx2 - 2) + + Select Case Array.IndexOf(EventNameTable, eventname) + Case 0 ' friends + Debug.Print("friends") + Continue Do + Case 1 ' その他イベント + Debug.Print("Event") + TraceOut("Event" + Environment.NewLine + line) + Continue Do + Case Else + ' + End Select + End If + res.Length = 0 res.Append("[") res.Append(line)