2010-12-14 3 views

답변

1

그래서 당신은 사용자에 의해 만들어진 모든 트윗 과 (일명 사용자에게 전송) 사용자을 언급 모든 트윗을 얻으려면? 첫 번째 참조하십시오

을 참조 초

http://dev.twitter.com/doc/get/statuses/public_timeline

, 당신은 후자의 API 호출에 액세스 할 수의 OAuth 인증을 사용해야합니다

http://dev.twitter.com/doc/get/statuses/mentions

.

+0

한 가지 더 트윗을 삭제할 수 있습니까 ?? – Sandhurst

+0

예. http://dev.twitter.com/doc/post/statuses/destroy/:id –

0

나는 최근에 뭔가를 썼다. 희망이 도움이됩니다. http://blog.rohit-lakhanpal.info/2013/06/console-app-that-displays-twitter-feed.html

using System; 
using System.Linq; 
using LinqToTwitter; 
using System.Threading; 

namespace Linq2Twitter 
{ 
    class Program 
    { 
     /// <summary> 
     /// Controls the flow of the program. 
     /// </summary> 
     /// <param name="args">The args.</param> 
     static void Main(string[] args) 
     { 
      // This is a super simple example that 
      // retrieves the latest tweets of a given 
      // twitter user. 

      // SECTION A: Initialise local variables 
      Console.WriteLine("SECTION A: Initialise local variables"); 

      // Access token goes here .. (Please generate your own) 
      const string accessToken = "Access token goes here .. (Please generate your own)"; 
      // Access token secret goes here .. (Please generate your own) 
      const string accessTokenSecret = "Access token secret goes here .. (Please generate your own)"; 

      // Api key goes here .. (Please generate your own) 
      const string consumerKey = "Api key goes here .. (Please generate your own)"; 
      // Api secret goes here .. (Please generate your own) 
      const string consumerSecret = "Api secret goes here .. (Please generate your own)"; 

      // The twitter account name goes here 
      const string twitterAccountToDisplay = "roeburg"; 


      // SECTION B: Setup Single User Authorisation 
      Console.WriteLine("SECTION B: Setup Single User Authorisation"); 
      var authorizer = new SingleUserAuthorizer 
      { 
       CredentialStore = new InMemoryCredentialStore 
       { 
        ConsumerKey = consumerKey, 
        ConsumerSecret = consumerSecret, 
        OAuthToken = accessToken, 
        OAuthTokenSecret = accessTokenSecret 
       } 
      }; 

      // SECTION C: Generate the Twitter Context 
      Console.WriteLine("SECTION C: Generate the Twitter Context"); 
      var twitterContext = new TwitterContext(authorizer); 

      // SECTION D: Get Tweets for user 
      Console.WriteLine("SECTION D: Get Tweets for user"); 
      var statusTweets = from tweet in twitterContext.Status 
           where tweet.Type == StatusType.User && 
             tweet.ScreenName == twitterAccountToDisplay && 
             tweet.IncludeContributorDetails == true && 
             tweet.Count == 10 && 
             tweet.IncludeEntities == true 
           select tweet; 

      // SECTION E: Print Tweets 
      Console.WriteLine("SECTION E: Print Tweets"); 
      PrintTweets(statusTweets); 
      Console.ReadLine(); 
     } 

     /// <summary> 
     /// Prints the tweets. 
     /// </summary> 
     /// <param name="statusTweets">The status tweets.</param> 
     /// <exception cref="System.NotImplementedException"></exception> 
     private static void PrintTweets(IQueryable<Status> statusTweets) 
     { 
      foreach (var statusTweet in statusTweets) 
      { 
       Console.WriteLine(string.Format("\n\nTweet From [{0}] at [{1}]: \n-{2}", 
        statusTweet.ScreenName, 
        statusTweet.CreatedAt, 
        statusTweet.Text)); 

       Thread.Sleep(1000); 
      } 
     } 
    } 
} 
관련 문제