Skip to content

Instantly share code, notes, and snippets.

@takeshik
Created February 12, 2010 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takeshik/302278 to your computer and use it in GitHub Desktop.
Save takeshik/302278 to your computer and use it in GitHub Desktop.
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