[英]Windows Phone 8 - Twitter API
我正在做一些研究,似乎無法找到一種確定的方法來查詢Twitter的API,以便使用C#獲取用戶在WP8上的推文。
Twitter用戶不是我自己的帳戶,我想要做的就是檢索推文而不發布任何推文。
因此,我需要驗證自己/我的應用程序嗎? TweetSharp
庫是否適合我的目標?
我使用了以下示例http://code.msdn.microsoft.com/wpapps/Twitter-Sample-using-f36bab75 :
if (NetworkInterface.GetIsNetworkAvailable())
{
//Obtain keys by registering your app on https://dev.twitter.com/apps
var service = new TwitterService("abc", "abc");
service.AuthenticateWith("abc", "abc");
//ScreenName is the profile name of the twitter user.
service.ListTweetsOnUserTimeline(new ListTweetsOnUserTimelineOptions() { ScreenName = "the_appfactory" }, (ts, rep) =>
{
if (rep.StatusCode == HttpStatusCode.OK)
{
//bind
this.Dispatcher.BeginInvoke(() => { tweetList.ItemsSource = ts; });
}
});
}
else
{
MessageBox.Show("Please check your internet connestion.");
}
我在twitter dev網站上創建了一個新的應用程序用戶: https : //dev.twitter.com/user/login?destination = home 。 設置完成后,我基本上復制並粘貼了AuthenticateWith
和TwitterService
方法中的密鑰。
我還沒有完全解決我將如何顯示數據,但在運行時,我可以看到傳入的數據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.