LINQ To TwitterのUserStreamをもっと使いやすくしようとか妄想してるプロジェクト
Revision | 6e1511e145b1f71c73fc10e96a73714c2f17eff4 (tree) |
---|---|
Zeit | 2011-02-07 20:53:17 |
Autor | azyobuzin <azyobuzin@user...> |
Commiter | azyobuzin |
・DirectMessageを受信したときに例外を吐くのを修正
・limitに対応
・Ver.1.0.1
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
32 | 32 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を |
33 | 33 | // 既定値にすることができます: |
34 | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.0.0.0")] | |
36 | -[assembly: AssemblyFileVersion("1.0.0.0")] | |
35 | +[assembly: AssemblyVersion("1.0.1.0")] | |
36 | +[assembly: AssemblyFileVersion("1.0.1.0")] |
@@ -13,4 +13,11 @@ LINQ to Twitter用UserStream補助ライブラリ | ||
13 | 13 | |
14 | 14 | 個人的にやってるものなのでご自由にお使いください(バイナリでもソースでも) |
15 | 15 | |
16 | -何かあったら@azyobuzinまで | |
\ No newline at end of file | ||
16 | +何かあったら@azyobuzinまで | |
17 | + | |
18 | +更新履歴 | |
19 | + 1.0.1 (2011/2/7) | |
20 | + ・DirectMessageを受信したときに例外を吐くのを修正 | |
21 | + ・limitに対応 | |
22 | + 1.0 (2011/2/6) | |
23 | + ・初版で適当 | |
\ No newline at end of file |
@@ -74,6 +74,10 @@ namespace Azyobuzi.UserStreamEx | ||
74 | 74 | { |
75 | 75 | if (ReceiveEvent != null) ReceiveEvent(this, new ReceiveEventEventArgs(_line)); |
76 | 76 | } |
77 | + else if (json.limit()) | |
78 | + { | |
79 | + if (TrackLimit != null) TrackLimit(this, new TrackLimitEventArgs(_line)); | |
80 | + } | |
77 | 81 | else if (json.text()) |
78 | 82 | { |
79 | 83 | if (NewTweet != null) NewTweet(this, new NewTweetEventArgs(_line)); |
@@ -118,6 +122,7 @@ namespace Azyobuzi.UserStreamEx | ||
118 | 122 | public event EventHandler<NewDirectMessageEventArgs> NewDirectMessage; |
119 | 123 | public event EventHandler<DeleteStatusEventArgs> DeleteStatus; |
120 | 124 | public event EventHandler<ReceiveEventEventArgs> ReceiveEvent; |
125 | + public event EventHandler<TrackLimitEventArgs> TrackLimit; | |
121 | 126 | public event EventHandler<ReceiveJsonEventArgs> ReceiveUnsupportedData; |
122 | 127 | } |
123 | 128 |
@@ -192,7 +197,7 @@ namespace Azyobuzi.UserStreamEx | ||
192 | 197 | ID = (ulong)json.id, |
193 | 198 | SenderID = (ulong)json.sender_id, |
194 | 199 | Text = json.text, |
195 | - RecipientID = json.recipient_id, | |
200 | + RecipientID = (ulong)json.recipient_id, | |
196 | 201 | CreatedAt = DateTime.ParseExact(json.created_at, "ddd MMM dd HH:mm:ss %zzzz yyyy", CultureInfo.InvariantCulture), |
197 | 202 | SenderScreenName = json.sender_screen_name, |
198 | 203 | RecipientScreenName = json.recipient_screen_name, |
@@ -267,6 +272,17 @@ namespace Azyobuzi.UserStreamEx | ||
267 | 272 | public List TargetList { private set; get; } |
268 | 273 | } |
269 | 274 | |
275 | + public class TrackLimitEventArgs : ReceiveJsonEventArgs | |
276 | + { | |
277 | + public TrackLimitEventArgs(string line) | |
278 | + : base(line) | |
279 | + { | |
280 | + Track = (ulong)DynamicJson.Parse(line).limit.track; | |
281 | + } | |
282 | + | |
283 | + public ulong Track { private set; get; } | |
284 | + } | |
285 | + | |
270 | 286 | public enum EventTypes |
271 | 287 | { |
272 | 288 | Unknown, |