svnno****@sourc*****
svnno****@sourc*****
2010年 11月 27日 (土) 23:16:36 JST
Revision: 1123 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1123 Author: syo68k Date: 2010-11-27 23:16:36 +0900 (Sat, 27 Nov 2010) Log Message: ----------- 接続の際にreplies,trackの各パラメータを指定できるように Modified Paths: -------------- branches/UserStream/Tween/Connection/HttpTwitter.vb branches/UserStream/Tween/Twitter.vb -------------- next part -------------- Modified: branches/UserStream/Tween/Connection/HttpTwitter.vb =================================================================== --- branches/UserStream/Tween/Connection/HttpTwitter.vb 2010-11-26 17:19:15 UTC (rev 1122) +++ branches/UserStream/Tween/Connection/HttpTwitter.vb 2010-11-27 14:16:36 UTC (rev 1123) @@ -1,5 +1,6 @@ Imports System.Net Imports System.IO +Imports System.Web Public Class HttpTwitter @@ -681,10 +682,20 @@ End If End Sub - Public Function UserStream(ByRef content As Stream) As HttpStatusCode + Public Function UserStream(ByRef content As Stream, ByVal allAtReplies As Boolean, ByVal trackwords As String) As HttpStatusCode + Dim param As New Dictionary(Of String, String) + + If allAtReplies Then + param.Add("replies", "all") + End If + + If Not String.IsNullOrEmpty(trackwords) Then + param.Add("track", trackwords) + End If + Return httpCon.GetContent(GetMethod, _ CreateTwitterStreamUri("/2/user.json"), _ - Nothing, _ + param, _ content) End Function End Class Modified: branches/UserStream/Tween/Twitter.vb =================================================================== --- branches/UserStream/Tween/Twitter.vb 2010-11-26 17:19:15 UTC (rev 1122) +++ branches/UserStream/Tween/Twitter.vb 2010-11-27 14:16:36 UTC (rev 1123) @@ -2840,7 +2840,7 @@ Do Try isRetry = False - twCon.UserStream(st) + twCon.UserStream(st, False, "") sr = New StreamReader(st) RaiseEvent UserStreamStarted() Do While _streamActive