LINQ To TwitterのUserStreamをもっと使いやすくしようとか妄想してるプロジェクト
| Revision | a65a4087e810e7323d7c4b696359b4bbd82f335d (tree) |
|---|---|
| Time | 2011-02-07 00:37:38 |
| Author | azyobuzin <azyobuzin@user...> |
| Commiter | azyobuzin |
テスト完了(ver.1.0)
| @@ -0,0 +1,16 @@ | ||
| 1 | +UserStreamEx 1.0 | |
| 2 | +LINQ to Twitter用UserStream補助ライブラリ | |
| 3 | + | |
| 4 | +動作環境:.NET Framework 4 (LINQ to Twitterの動作に3.5も必要) | |
| 5 | + | |
| 6 | +使い方 | |
| 7 | + Azyobuzi.UserStreamEx名前空間をインポートしてTwitterContext.UserStreamEx()拡張メソッドを呼び出すとインスタンスが作成されます。 | |
| 8 | + あとは、Startメソッドを呼ぶだけ。 | |
| 9 | + | |
| 10 | +使用しているライブラリ | |
| 11 | + DynamicJson - http://dynamicjson.codeplex.com/ | |
| 12 | + LINQ to Twitter - http://linqtotwitter.codeplex.com/ | |
| 13 | + | |
| 14 | +個人的にやってるものなのでご自由にお使いください(バイナリでもソースでも) | |
| 15 | + | |
| 16 | +何かあったら@azyobuzinまで | |
| \ No newline at end of file |
| @@ -164,7 +164,7 @@ namespace Azyobuzi.UserStreamEx | ||
| 164 | 164 | public ReceiveFriendsEventArgs(string line) |
| 165 | 165 | : base(line) |
| 166 | 166 | { |
| 167 | - FriendIds = DynamicJson.Parse(line).friends; | |
| 167 | + FriendIds = (string[])DynamicJson.Parse(line).friends; | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public string[] FriendIds { private set; get; } |
| @@ -209,7 +209,7 @@ namespace Azyobuzi.UserStreamEx | ||
| 209 | 209 | public DeleteStatusEventArgs(string line) |
| 210 | 210 | : base(line) |
| 211 | 211 | { |
| 212 | - var json = DynamicJson.Parse(line); | |
| 212 | + var json = DynamicJson.Parse(line).delete; | |
| 213 | 213 | if (!json.direct_message()) |
| 214 | 214 | { |
| 215 | 215 | //ツイート |
| @@ -242,8 +242,8 @@ namespace Azyobuzi.UserStreamEx | ||
| 242 | 242 | eventType = EventTypes.Unknown; |
| 243 | 243 | EventType = eventType; |
| 244 | 244 | CreatedAt = DateTime.ParseExact(json.created_at, "ddd MMM dd HH:mm:ss %zzzz yyyy", CultureInfo.InvariantCulture).ToLocalTime(); |
| 245 | - Source = User.CreateUser(((string)json.source).JsonToXml()); | |
| 246 | - Target = User.CreateUser(((string)json.target).JsonToXml()); | |
| 245 | + Source = User.CreateUser(((string)json.source.ToString()).JsonToXml()); | |
| 246 | + Target = User.CreateUser(((string)json.target.ToString()).JsonToXml()); | |
| 247 | 247 | if (json.target_object()) |
| 248 | 248 | { |
| 249 | 249 | if (json.target_object.mode()) |
| @@ -55,6 +55,9 @@ | ||
| 55 | 55 | <Content Include="DynamicJson.dll" /> |
| 56 | 56 | <Content Include="LinqToTwitter\LinqToTwitter.dll" /> |
| 57 | 57 | <Content Include="LinqToTwitter\LinqToTwitter.pdb" /> |
| 58 | + <Content Include="Readme.txt"> | |
| 59 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
| 60 | + </Content> | |
| 58 | 61 | </ItemGroup> |
| 59 | 62 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
| 60 | 63 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |