我正在尝试使用 Linq To Twitter 最新版本 3.0.2 获取关注者。但它没有返回任何响应,也没有抛出任何错误。请建议
var followers = GetTwitterFollowers
(twitterUserId, auth, maxFollowers);
var foll = followers.ContinueWith(f =>
{
return f.Result;
}).Result;
“GetTwitterFollowers”方法定义为:
private static async Task<List<TwitterData>> GetTwitterFollowers(
ulong twitterUserId, SingleUserAuthorizer auth, int? maxFollowers)
{
var follower = maxFollowers ?? 15000;
try
{
var twitterCtx = new TwitterContext(auth);
var followers = await twitterCtx.Friendship
.Where(f => f.Type == FriendshipType.FollowersList
&& f.UserID == twitterUserId.ToString())
.Select(f => new TwitterData()
{
Followers = f.Users.Where(t => !t.Protected).Take(follower).Select(s => s).ToList()
}).SingleOrDefaultAsync();
return GetFollowersList(followers.Followers);
}
catch (Exception ex)
{
return null;
}
}