Created
February 12, 2010 03:57
-
-
Save takeshik/302278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Runtime.Remoting; | |
using System.Runtime.Remoting.Channels; | |
using System.Runtime.Remoting.Channels.Tcp; | |
using XSpect.MetaTweet; | |
using XSpect.MetaTweet.Modules; | |
using XSpect.MetaTweet.Objects; | |
internal class ClientTest | |
{ | |
private static void Main() | |
{ | |
TcpClientChannel channel = new TcpClientChannel(); | |
Console.Write("register channel, "); | |
ChannelServices.RegisterChannel(channel); | |
Console.Write("register client, "); | |
RemotingConfiguration.RegisterWellKnownClientType(typeof(ServerCore), "tcp://localhost:7784/core"); | |
Console.Write("activate, "); | |
ServerCore server = Activator.CreateInstance<ServerCore>(); | |
Console.WriteLine("got Storage!"); | |
StorageModule storage = server.ModuleManager.GetModule<StorageModule>("main"); | |
Console.WriteLine("*** Timeline ***"); | |
foreach (Activity activity in storage.GetActivities(null, null, "Post", null).Take(100)) | |
{ | |
Console.WriteLine(String.Format("{0} @ {1}: {2}", | |
activity.Account["ScreenName"].Value, | |
activity.Timestamp, | |
activity.Value | |
)); | |
} | |
Console.Write("*** All activities ***"); | |
Console.Write("Press Enter key to continue"); | |
Console.ReadLine(); | |
foreach (Activity activity in storage.GetActivities().Take(500)) | |
{ | |
Console.WriteLine(String.Format("{0} @ {1} {2}: {3}", | |
activity.Account["ScreenName"].Value, | |
activity.Timestamp, | |
activity.Category, | |
activity.Value | |
)); | |
} | |
Console.Write("Press Enter key to exit"); | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment