Esempio n. 1
0
        public TweetSearchResponseDTO SearchForTweets(string query,
                                                      int numberofTweets,
                                                      string language)
        {
            string responseJSON = SendGET(_SearchTweets
                                          + "?q=" + query
                                          + "&count=" + numberofTweets
                                          + "&lang=" + language);

            TweetSearchResponseDTO responseDTO =
                JsonConvert.DeserializeObject <TweetSearchResponseDTO>(responseJSON);

            return(responseDTO);
        }
Esempio n. 2
0
        static void InvokeSearch(string query, int numberOfTweets,
                                 string language)
        {
            string consumerKey =
                "1fba23y2C0iV6elj2pPavdKid";
            string consumerSecret =
                "aGXkCSZWbHILwJHrXR6kfQ7T6aetcHgGJbGWY4tnJCCo0fz33D";
            TwitterClient twitterClient =
                new TwitterClient(consumerKey, consumerSecret);

            TweetSearchResponseDTO responseDTOs =
                twitterClient.SearchForTweets(query, numberOfTweets, language);

            foreach (Status status in responseDTOs.statuses)
            {
                Console.WriteLine("ID:" + status.id_str
                                  + ". Text:"
                                  + status.text);
            }
        }