Stream2Queue() public method

public Stream2Queue ( ) : void
return void
        static void Main(string[] args)
        {
            TwitterStream stream = new TwitterStream();
            Logger        logger = new Logger();
            string        arg1   = "";

            try
            {
                if (args.Length > 0)
                {
                    arg1 = args[0];
                }

                switch (arg1)
                {
                case "/?":
                    Console.WriteLine("Twitter Stream Client.\n");
                    Console.WriteLine("twitterstreamclient [/p]\n");
                    Console.WriteLine("[]\t\t\tProcess the Twitter Stream to a Message Queue.");
                    Console.WriteLine("/p\t\t\tProcess the Message Queue.");
                    Console.WriteLine("/encrypt password\tEncrypt a Twitter password for the config file.\n");
                    Console.WriteLine("\nPress any key to continue . . .");
                    Console.ReadKey();
                    break;

                case "/encrypt":
                    if (args.Length > 1)
                    {
                        Console.WriteLine(Common.Encrypt(args[1]));
                    }
                    break;

                case "/p":
                    stream.QueueRead();
                    break;

                default:
                    stream.Stream2Queue();
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                logger.append(ex.Message, Logger.LogLevel.ERROR);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            TwitterStream stream = new TwitterStream();
            Logger logger = new Logger();
            string arg1 = "";

            try
            {
                if (args.Length > 0)
                {
                    arg1 = args[0];
                }

                switch (arg1)
                {
                    case "/?":
                        Console.WriteLine("Twitter Stream Client.\n");
                        Console.WriteLine("twitterstreamclient [/p]\n");
                        Console.WriteLine("[]\t\t\tProcess the Twitter Stream to a Message Queue.");
                        Console.WriteLine("/p\t\t\tProcess the Message Queue.");
                        Console.WriteLine("/encrypt password\tEncrypt a Twitter password for the config file.\n");
                        Console.WriteLine("\nPress any key to continue . . .");
                        Console.ReadKey();
                        break;
                    case "/encrypt":
                        if (args.Length > 1)
                        {
                            Console.WriteLine(Common.Encrypt(args[1]));
                        }
                        break;
                    case "/p":
                        stream.QueueRead();
                        break;
                    default:
                        stream.Stream2Queue();
                        break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                logger.append(ex.Message, Logger.LogLevel.ERROR);
            }
        }