当前位置: 首页>>代码示例>>C#>>正文


C# IUserSession.GetUsersDetailsFull方法代码示例

本文整理汇总了C#中IUserSession.GetUsersDetailsFull方法的典型用法代码示例。如果您正苦于以下问题:C# IUserSession.GetUsersDetailsFull方法的具体用法?C# IUserSession.GetUsersDetailsFull怎么用?C# IUserSession.GetUsersDetailsFull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUserSession的用法示例。


在下文中一共展示了IUserSession.GetUsersDetailsFull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoUserAccountTest


//.........这里部分代码省略.........
                    var blockListCount = 0;

                    do
                    {
                        var blockList = await session.GetBlockList(cursor: nextcursor);
                        if (blockList.twitterFaulted) continue;
                        nextcursor = blockList.next_cursor;
                        ConsoleOutput.PrintMessage(String.Format("Previous cursor: {0} Next cursor: {1}",
                            blockList.previous_cursor, blockList.next_cursor));
                        foreach (var l in blockList.users)
                        {
                            blockListCount++;
                            ConsoleOutput.PrintMessage(String.Format("ScreenName: {0} User ID: {1} Description: {2}",
                                l.Name, l.UserId, l.Description));
                        }
                    } while (nextcursor != 0);

                    ConsoleOutput.PrintMessage(String.Format("Block List Count: {0}",
                        blockListCount));
                }
                // 6
                if (testSeq.Contains(6))
                {
                    ConsoleOutput.PrintMessage("1.6 UsersExtensions\\DeleteUserBlock", ConsoleColor.Gray);
                    var deleteUserBlock = await session.DeleteUserBlock(screenName: "NickHodgeMSFT");
                    if (deleteUserBlock.OK)
                        ConsoleOutput.PrintMessage(String.Format("ScreenName: {0}", deleteUserBlock.ScreenName));
                    else
                        successStatus = false;
                }
                // 7
                if (testSeq.Contains(7))
                {
                    ConsoleOutput.PrintMessage("1.7 UsersExtensions\\GetUsersDetailsFull From Screennames ",
                        ConsoleColor.Gray);
                    var screennames = new List<string> {"shiftkey", "katyperry"};
                    var getUserDetailsFullFromScreenNames = await session.GetUsersDetailsFull(screenNames: screennames);
                    if (getUserDetailsFullFromScreenNames.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}",
                            getUserDetailsFullFromScreenNames.Count()));
                        foreach (var u in getUserDetailsFullFromScreenNames)
                        {
                            ConsoleOutput.PrintMessage(String.Format("User ID: {1} // ScreenName: {0} // Description: {2}",
                                u.Name, u.UserId, u.Description));
                        }
                    }
                    else
                        successStatus = false;
                }
                // 8
                if (testSeq.Contains(8))
                {
                    ConsoleOutput.PrintMessage("1.8 UsersExtensions\\GetUsersDetailsFull From IDs", ConsoleColor.Gray);
                    var usersids = new List<long> { 21447363, 14671135, 4503599627370241};
                    var getUserDetailsFullFromIDs = await session.GetUsersDetailsFull(userIds: usersids);
                    if (getUserDetailsFullFromIDs.OK)
                    {
                        ConsoleOutput.PrintMessage(String.Format("Returned: {0}", getUserDetailsFullFromIDs.Count()));
                        foreach (var u in getUserDetailsFullFromIDs)
                        {
                            ConsoleOutput.PrintMessage(String.Format(
                                "ScreenName: {0} User ID: {1} Description: {2}",
                                u.Name, u.UserId, u.Description));
                        }
                    }
开发者ID:nickhodge,项目名称:BoxKite.Twitter,代码行数:67,代码来源:01UserAccountLiveFireTests.cs

示例2: DoCombosTest

        public async Task<bool> DoCombosTest(IUserSession session, List<int> testSeq)
        {
            var successStatus = true;
            var trendToFollow = "";
            try
            {
                // 1
                if (testSeq.Contains(1))
                {
                    //-33.884097,151.134796
                    ConsoleOutput.PrintMessage("11.1 Combo\\GetTrendsByLocation then Searchstream for 2 minutes", ConsoleColor.Gray);
                    var combo1 = await session.GetTrendsByLocation(latitude:-33.884097,longitude:151.134796);

                    if (combo1.OK)
                    {
                        trendToFollow = combo1[0].Name; // grab the first
                        foreach (var trnd in combo1)
                        {
                            ConsoleOutput.PrintMessage(
                                String.Format("Trend Test: {0}", trnd.Name));
                        }
                    }
                    else
                    {
                        successStatus = false;
                        throw new Exception("cannot trends");
                    }

                    var searchstream = session.StartSearchStream(track: trendToFollow);
                    searchstream.FoundTweets.Subscribe(t => ConsoleOutput.PrintTweet(t));
                    searchstream.Start();

                    Thread.Sleep(TimeSpan.FromMinutes(2));
                    searchstream.CancelStream.Cancel();
                    searchstream.Stop();  
            }


                // 2
                if (testSeq.Contains(2))
                {
                    ConsoleOutput.PrintMessage("11.2 Combo\\GetFriendshipRequestsOutgoing, then hydrate User Details", ConsoleColor.Gray);

                    long nextcursor = -1;
                    var ff5ListCount = 0;
                    var userids2 = new List<long>(); 

                    do
                    {
                        var ff2List = await session.GetFriendshipRequestsOutgoing(cursor: nextcursor);
                        if (ff2List.twitterFaulted)
                        {
                            successStatus = false;
                            break;
                        };
                        nextcursor = ff2List.next_cursor;
                        ConsoleOutput.PrintMessage(String.Format("Previous cursor: {0} Next cursor: {1}",
                            ff2List.previous_cursor, ff2List.next_cursor));
                        foreach (var l in ff2List.UserIDs)
                        {
                            userids2.Add(l);
                            ff5ListCount++;
                            ConsoleOutput.PrintMessage(String.Format("User ID: {0}", l));
                        }
                    } while (nextcursor != 0);

                    ConsoleOutput.PrintMessage(String.Format("Total Outstanding Outgoing Friend Requests Count: {0}",
                       ff5ListCount));

                    if (userids2.Any())
                    {
                        var userlist2 = await session.GetUsersDetailsFull(userIds: userids2);
                        if (userlist2.OK)
                        {
                            foreach (var requsers in userlist2)
                            {
                                ConsoleOutput.PrintMessage(
                                    String.Format("UserID: {0} // ScreenName: {1}", requsers.UserId, requsers.ScreenName));
                            }

                        }
                        else
                        {
                            successStatus = false;
                        }
                    }
                }

                // 3
                if (testSeq.Contains(3))
                {
                    ConsoleOutput.PrintMessage("11.3 Combo\\GetFriendshipRequestsIncoming, then hydrate User Details", ConsoleColor.Gray);

                    long nextcursor = -1;
                    var ff5ListCount = 0;
                    var userids3 = new List<long>();

                    do
                    {
                        var ff3List = await session.GetFriendshipRequestsIncoming(cursor: nextcursor);
//.........这里部分代码省略.........
开发者ID:gerryaobrien,项目名称:BoxKite.Twitter,代码行数:101,代码来源:11CombosLiveFireTests.cs


注:本文中的IUserSession.GetUsersDetailsFull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。