繁体   English   中英

Windows Phone 8 - Twitter API

[英]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 设置完成后,我基本上复制并粘贴了AuthenticateWithTwitterService方法中的密钥。

我还没有完全解决我将如何显示数据,但在运行时,我可以看到传入的数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM