Esempio n. 1
0
        public List <Status> GetTweets(string twitterHashTag)
        {
            List <Status> lstTweets = new List <Status>();

            // New Code added for Twitter API 1.1
            if (!string.IsNullOrEmpty(twitterHashTag))
            {
                var twitter = new TwitterHelper(ConfigurationManager.AppSettings["OauthConsumerKey"],
                                                ConfigurationManager.AppSettings["OauthConsumerKeySecret"],
                                                ConfigurationManager.AppSettings["OauthAccessToken"],
                                                ConfigurationManager.AppSettings["OauthAccessTokenSecret"]);

                var response = twitter.GetTweets(twitterHashTag, 100);

                var timeline = JsonConvert.DeserializeObject <TwitterModel>(response);

                lstTweets.AddRange(timeline.statuses);
            }
            return(lstTweets);
        }
Esempio n. 2
0
        public List<Status> GetTweets(string twitterHashTag)
        {
            List<Status> lstTweets = new List<Status>();

            // New Code added for Twitter API 1.1
            if (!string.IsNullOrEmpty(twitterHashTag))
            {
                var twitter = new TwitterHelper(ConfigurationManager.AppSettings["OauthConsumerKey"],
                                                ConfigurationManager.AppSettings["OauthConsumerKeySecret"],
                                                ConfigurationManager.AppSettings["OauthAccessToken"],
                                                ConfigurationManager.AppSettings["OauthAccessTokenSecret"]);

                var response = twitter.GetTweets(twitterHashTag, 100);

                var timeline = JsonConvert.DeserializeObject<TwitterModel>(response);

                lstTweets.AddRange(timeline.statuses);
            }
            return lstTweets;
        }