0
A
回答
1
所以你想獲得用戶所做的所有鳴叫和提及用戶(又名被髮送到用戶)所有的鳴叫?
對於先看到的,
http://dev.twitter.com/doc/get/statuses/public_timeline
對於第二個看到,
http://dev.twitter.com/doc/get/statuses/mentions
您需要使用OAuth認證訪問後者API調用。
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);
}
}
}
}
相關問題
- 1. Twitter4j:顯示在特定用戶帳戶上搜索詞的所有推文
- 2. 如何刪除特定Twitter帳戶的所有推文?
- 3. XAML-Twitter客戶端。獲取來自用戶的所有推文
- 4. 如何顯示有多少用戶在推送頁面上
- 5. 如何發送來自所選Twitter帳戶的推文
- 6. 在網頁上顯示Twitter推文
- 7. 發佈到Facebook頁面和Twitter帳戶
- 8. 在所有aspx頁面上顯示用戶名稱
- 9. twitter應用程序以推特登錄用戶的帳戶
- 10. 獲取Twitter用戶的所有推文,限速問題
- 11. Twitter API獲取任何用戶的所有推文
- 12. 突出顯示ASP.NET頁面中的所有用戶控件
- 13. Prestashop 1.6 - 在帳戶頁面顯示客戶組(前端)
- 14. 訪問用戶的Twitter帳戶IOS
- 15. iOS上還沒有Twitter帳戶設備
- 16. 用戶帳戶頁面上的Drupal目標參數不持久?
- 17. 如何刪除我的HyperTrack帳戶上的所有用戶?
- 18. (Drupal的twitter模塊)添加用於登錄的Twitter帳戶,自動到該用戶的Twitter帳戶列表
- 19. 顯示所有用戶
- 20. 顯示所有用戶liferay
- 21. 從自己的Twitter帳戶牆中檢索推文
- 22. 如何將推文發送到我的Twitter帳戶?
- 23. 將Rails 3應用程序用戶帳戶連接到用戶的Twitter帳戶
- 24. 在用戶頁面上顯示用戶名
- 25. 一旦他允許我的網站訪問他的Twitter帳戶,在我的網站上顯示用戶在他賬戶中的推文?
- 26. 使用Twitter登錄已有帳戶的用戶
- 27. API的Twitter帳戶1.1/update_profile_image
- 28. Concrete5用戶帳戶/添加用戶頁面上的動態選擇列表
- 29. 使用Javascript檢索帳戶的所有子帳戶
- 30. 的Rails:顯示用戶頁面上的用戶後的form_for嵌套路線
還有一件事我們可以刪除tweet嗎? – Sandhurst 2010-12-14 10:49:35
是的。 http://dev.twitter.com/doc/post/statuses/destroy/:id – 2010-12-14 10:55:04