+ " <URL:http://wiki.github.com/joshsh/twitlogic/configuring-and-running-twitlogic>.");
}
private static void runDemo() throws Exception {
// Create a persistent store.
TweetStore store = new TweetStore();
store.initialize();
boolean exitedNormally = false;
try {
// Create a client for communication with Twitter.
TwitterClient client = new Twitter4jClient();
//TwitterClient client = new CustomTwitterClient();
// Launch linked data server.
store.startServer(client);
Handler<Tweet> annotator
= createAnnotator(store, client);
// Create an agent to listen for commands.
// Also take the opportunity to memoize users we're following.
/*
TwitLogicAgent agent = new TwitLogicAgent(client);
UserRegistry userRegistry = new UserRegistry(client);
Handler<Tweet, TweetHandlerException> realtimeStatusHandler
= userRegistry.createUserRegistryFilter(
new CommandListener(agent, annotator));
*/
Set<User> users = TwitLogic.findFollowList(client);
Set<String> terms = TwitLogic.findTrackTerms();
GregorianCalendar cal = new GregorianCalendar(2010, GregorianCalendar.MAY, 1);
//gatherHistoricalTweets(store, client, users, cal.getTime());
TweetReceivedLogger rLogger = new TweetReceivedLogger(client.getStatistics(), annotator);
TweetDeleter d = new TweetDeleter(store);
client.processFilterStream(users, terms, null, rLogger, d, 0);
exitedNormally = true;
} finally {
if (!exitedNormally) {
LOGGER.warning("exited abnormally");
}
store.shutDown();
}
}