Example #1
0
        protected override void Execute_TwitterDefinition(TwitterCommandContext context)
        {
            var interpreter = context.Interpreter;
            var users       = context.TwitterUsers;

            string username = context.ReadParameter("Username").Value;
            string password = context.ReadParameter("Password").Value;

            foreach (string otherUsername in users.Keys)
            {
                if (otherUsername.Equals(username))
                {
                    throw new RoomieRuntimeException("User " + username + " already signed in.");
                }
            }

            try
            {
                var newUser = new Twitterizer.Framework.Twitter(username, password);
                users.Add(username, newUser);
            }
            catch (Twitterizer.Framework.TwitterizerException e)
            {
                throw new RoomieRuntimeException("Failed to sign in.  Recieved the following error: " + e.Message);
            }
        }
Example #2
0
        protected override void Execute_TwitterDefinition(TwitterCommandContext context)
        {
            var user = context.User;

            string text = context.ReadParameter("Text").Value;
            try
            {
                user.Status.Update(text);
            }
            catch (Twitterizer.Framework.TwitterizerException e)
            {
                throw new RoomieRuntimeException(e.Message);
            }
        }
Example #3
0
        protected override void Execute_TwitterDefinition(TwitterCommandContext context)
        {
            var user = context.User;

            string text = context.ReadParameter("Text").Value;

            try
            {
                user.Status.Update(text);
            }
            catch (Twitterizer.Framework.TwitterizerException e)
            {
                throw new RoomieRuntimeException(e.Message);
            }
        }
Example #4
0
        protected override void Execute_TwitterDefinition(TwitterCommandContext context)
        {
            var interpreter = context.Interpreter;
            var users = context.TwitterUsers;

            string username = context.ReadParameter("Username").Value;
            string password = context.ReadParameter("Password").Value;

            foreach (string otherUsername in users.Keys)
            {
                if (otherUsername.Equals(username))
                    throw new RoomieRuntimeException("User " + username + " already signed in.");
            }

            try
            {
                var newUser = new Twitterizer.Framework.Twitter(username, password);
                users.Add(username, newUser);
            }
            catch (Twitterizer.Framework.TwitterizerException e)
            {
                throw new RoomieRuntimeException("Failed to sign in.  Recieved the following error: " + e.Message);
            }
        }