static void Main( string[] args )
        {
            AppDomain.CurrentDomain.UnhandledException += AppUnhandledExceptions;

            var config = ConfigurationManager.GetSection( "XemantiX.Crawler.Config" ) as Config;

            var crawler = Activator.CreateInstance( config.Crawler, config.Instance ).Unwrap() as ICrawler;

            if( crawler != null )
            {
                var tycheDb = new TycheDbDataContext( config.SqlServerConnection );

                crawler.TycheDb = tycheDb;

                String infoMessage = String.Format( "Instantiating and running -> {0}", crawler.ToString() );

                System.Console.WriteLine( infoMessage );

                crawler.Start();
                crawler.Stop();
            }

            System.Console.WriteLine( "Done. Press Enter." );
            System.Console.ReadLine();
        }
 /// <summary>
 /// Run all search related demos
 /// </summary>
 /// <param name="twitterCtx">TwitterContext</param>
 public static void Run(TwitterContext twitterCtx, TycheDbDataContext db)
 {
     //SearchTwitterDemo(twitterCtx);
     //SearchOperatorDemo(twitterCtx);
     //SearchTwitterSinceIDDemo(twitterCtx);
     //SearchTwitterLocationDemo(twitterCtx);
     //SearchTwitterLocaleDemo(twitterCtx);
     //SearchAndUseStatusTwitterDemo(twitterCtx);
     //SearchByLanguageTwitterDemo(twitterCtx);
     //SearchSinceDateTwitterDemo(twitterCtx);
     //SearchTwitterSource(twitterCtx);
     //ExceedSearchRateLimitDemo(twitterCtx);
     //SearchWithResultType(twitterCtx);
     SearchWithWordQuery(twitterCtx, db);
     //SearchWithPersonReferenceQuery(twitterCtx);
     //SearchWithPersonFromQuery(twitterCtx);
     //SearchWithAttitudeQuery(twitterCtx);
     //SearchWithLinksQuery(twitterCtx);
     //SearchCountDemo(twitterCtx);
     //SearchDatesDemo(twitterCtx);
     //SearchEntriesQueryDemo(twitterCtx);
     //SearchGeoCodeDemo(twitterCtx);
     //SearchGeoCodeAndShowUserDemo(twitterCtx);
 }
        /// <summary>
        /// Demonstrates how to use words parameters
        /// </summary>
        /// <param name="twitterCtx">TwitterContext</param>
        private static void SearchWithWordQuery(TwitterContext twitterCtx, TycheDbDataContext db)
        {
            var queryResults =
                from search in twitterCtx.Search
                where search.Type == SearchType.Search &&
                      search.WordAnd == "LINQ Twitter"
                select search;

            foreach (var search in queryResults)
            {
                Console.WriteLine("\nQuery:\n" + search.Title);

                foreach (var entry in search.Entries)
                {
                    //Persistence.Interaction interaction = new Persistence.Interaction();
                    //interaction.Content_id = entry.Content;
                    //interaction.Message_id = entry.ID;
                    //interaction.Reply_to_id = entry.Author.Name;

                    Console.WriteLine(
                        "ID: {0}, As of: {1}\nContent: {2}\n",
                        entry.ID, entry.Updated, entry.Content);
                }
            }
        }