0

嗨,我想在我的 mvc.net 应用程序中使用 Tweetsharp 来获取朋友列表并与他们分享图像。但是我没有正确的文档和样本。需要在控制器操作中添加什么以及在视图页面中添加什么。

请提供一些相同的链接。

谢谢

穆尼什

4

2 回答 2

0
public void MyMethod() {
    TwitterService service = new TwitterService(key, secret, "Token", "Secret");

    ListFriendsOptions options = new ListFriendsOptions();
    options.Cursor = 12345;

    // should the response have user entities
    options.IncludeUserEntities = false;

    // The screen name of the user for whom to return results for.
    options.ScreenName = "";

    options.SkipStatus = false;

    // The ID of the user for whom to return results for.
    options.UserId = 12345;

    // this will return a list of friends for the specified user.
    TwitterCursorList<TwitterUser> listOfFriends = service.ListFriends(options);
}

另请注意,上面的代码使用了一个名为 TweetSharp 的第三方库。

至于图像,我不确定该怎么做,但您可以查看 twitter REST API v1.1 以获取信息

https://dev.twitter.com/docs/api/1.1/get/friends/list

https://dev.twitter.com/docs/api/1.1

TweetSharp https://github.com/danielcrenna/tweetsharp

于 2013-07-27T02:25:25.347 回答
-1

我不知道 Tweetsharp 但看看linq2twitter。它通过使用 LINQ 提供对 Twitter API 的轻松访问。

于 2011-01-24T07:11:08.913 回答