1
我試圖從Twitter的鳴叫,但它不跟我合作,讓鳴叫,這裏是代碼:通過LinqToTwitter
var auth = new SingleUserAuthorizer
{
CredentialStore = new SingleUserInMemoryCredentialStore()
{
ConsumerKey = ConfigurationManager.AppSettings["***"],
ConsumerSecret = ConfigurationManager.AppSettings["***"],
AccessToken = ConfigurationManager.AppSettings["***"],
AccessTokenSecret = ConfigurationManager.AppSettings["***"]
}
};
var context = new TwitterContext(auth);
var tweets =
from tw in context.Status
where
tw.Type == StatusType.User &&
tw.ScreenName == "***"
select tw;
// handle exceptions, twitter service might be down
try
{
// map to list
tweets
.Take(3)
.Select(t =>
new Tweets
{
//Username = t.ScreenName,
//FullName = t.User.Name,
TweetText = t.Text,
//FormattedText = ParseTweet(t.Text)
})
.ToList();
}
catch (Exception) { }
每次
當我試圖讀取鳴叫它失敗,例外是
LinqToTwitter.TwitterQueryException: Bad Authentication data
但我確定憑證是正確的。
也有可能讀取另一個Twitter帳戶的帖子?像公司帳戶或慶祝帳戶?
謝謝你對我的作品:) – Ateeq