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