Exemplo n.º 1
0
        private async void GetUserFollowers(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            //TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            //TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            //UserGridVisible = Windows.UI.Xaml.Visibility.Visible;

            //Do verification
            _twitterSearchText = String.IsNullOrEmpty(TwitterSearchText) ? _authenticatedUser : TwitterSearchText;
            if (!String.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI = new TweetAPICall();
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                UserFollowers = await tweetAPI.FollowersByUser(TwitterSearchText);

                GridViewTweets = UserFollowers;
            }
            else
            {
                throw new ArgumentNullException("No Twitter Screen Name Provided");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieve Search by Topic Tweets
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetSearchTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            //TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            //TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            //UserGridVisible = Windows.UI.Xaml.Visibility.Collapsed;

            if (!string.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI     = new TweetAPICall();
                SearchTweets = await tweetAPI.TweetsbySearch(TwitterSearchText);

                GridViewTweets = SearchTweets;
            }
            else
            {
                throw new Exception("Search Query Cannot Be Empty");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieve Tweets for the Twitter User (Home Timeline Tweets)
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetHomeTimelineTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            ////Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            //TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            //TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            //UserGridVisible = Windows.UI.Xaml.Visibility.Collapsed;

            try
            {
                tweetAPI       = new TweetAPICall();
                UserHomeTweets = await tweetAPI.TweetsbyHomeTimeline();

                GridViewTweets = UserHomeTweets;
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Retrieve Tweets Trend Topics
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetTrendTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TrendGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible  = Windows.UI.Xaml.Visibility.Collapsed;

            try
            {
                tweetAPI          = new TweetAPICall();
                GlobalTrendTweets = await tweetAPI.TweetsbyTrend(null);

                //GridViewTweets = GlobalTrendTweets;
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                //UserTweets = await tweetAPI.TweetsByUser(UserScreenName);
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
        }
Exemplo n.º 5
0
        private async void GetTwitterUserInfo(int TwitAuthType)
        {
            string usersToSearch = String.Empty;

            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            usersToSearch = String.IsNullOrEmpty(TwitterSearchText) ? _authenticatedUser : TwitterSearchText;
            //Do verification
            tweetAPI = new TweetAPICall();
            //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
            UserFollowers = await tweetAPI.TwitterUserInfo(usersToSearch);

            GridViewTweets = UserTweets;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Retrieve Tweets Trend Topics
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetTrendTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            try
            {
                tweetAPI          = new TweetAPICall();
                GlobalTrendTweets = await tweetAPI.TweetsbyTrend(null);

                GridViewTweets = GlobalTrendTweets;
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
        }