【问题标题】:tweetsharp implementation in mvc.netmvc.net 中的 tweetsharp 实现
【发布时间】:2011-01-24 05:16:41
【问题描述】:

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

请提供一些相同的链接。

谢谢

吃饱

【问题讨论】:

    标签: tweetsharp


    【解决方案1】:
    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

    【讨论】:

      【解决方案2】:

      我不了解 Tweetsharp,但请查看 linq2twitter。它通过使用 LINQ 提供对 Twitter API 的轻松访问。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-05
        • 1970-01-01
        • 2012-07-01
        • 2011-07-03
        相关资源
        最近更新 更多