Ejemplo n.º 1
0
        public void getTwitterUserData(string user_name)
        {
            //List
            UserTimeline userTimelineChoreo = new UserTimeline(session);

            Show showChoreo = new Show(session);
            showChoreo.setScreenName(user_name);
            showChoreo.setAccessToken(accessToken);
            showChoreo.setAccessTokenSecret(accessTokenSecret);
            showChoreo.setConsumerSecret(consumer_secret);
            showChoreo.setConsumerKey(consumer_key);
            showChoreo.setIncludeEntities("false");

            // Get user date
            ShowResultSet showResults = showChoreo.execute();
            // Get user_id
            string s_user = showResults.Response;
            JObject json_user = JObject.Parse(s_user);
            string user_id = (string)json_user["id"];

            // Set inputs for user tweets
            userTimelineChoreo.setAccessToken(accessToken);
            userTimelineChoreo.setAccessTokenSecret(accessTokenSecret);
            userTimelineChoreo.setConsumerSecret(consumer_secret);
            userTimelineChoreo.setUserId(user_id);
            userTimelineChoreo.setConsumerKey(consumer_key);
            userTimelineChoreo.setCount("200");

            // Execute Choreo for users timeline tweets
            UserTimelineResultSet userTimelineResults = userTimelineChoreo.execute();

            //Create JSON objects
            string s_tweets = userTimelineResults.Response;
            string s2_tweets = "{\"statuses\":" + s_tweets + "}";
            processTweeting(s2_tweets, "");

            Mentions mentionsChoreo = new Mentions(session);

            // Set inputs for mentions

            mentionsChoreo.setAccessToken(accessToken);
            mentionsChoreo.setAccessTokenSecret(accessTokenSecret);
            mentionsChoreo.setConsumerSecret(consumer_secret);
            mentionsChoreo.setConsumerKey(consumer_key);

            // Get mentions
            MentionsResultSet mentionsResults = mentionsChoreo.execute();

            s_tweets = mentionsResults.Response;
            s2_tweets = "{\"statuses\":" + s_tweets + "}";
            processTweeting(s2_tweets, user_name);
        }