private void processFollowing(string id, string html) { string followingIdPattern = @"<a href=""/(?<data>[^""]+)"" class=""url"" hreflang=""en"" rel=""contact"""; Match matchPattern = Regex.Match(html, followingIdPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); int counter = 0; while (matchPattern.Success) { string followingId = matchPattern.Groups["data"].ToString().Trim(); twuserLinkData.Create(id, followingId); matchPattern = matchPattern.NextMatch(); counter++; } Console.WriteLine("\tAdded " + (counter) + " followees to " + id + " (seedCounter=" + seedCounter + ")"); }
private void processFollowing(string id, string html) { string followingIdPattern = @"<a href=""/(?<data>[^""]+)"" class=""url"" hreflang=""en"" rel=""contact"""; Match matchPattern = Regex.Match(html, followingIdPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); int counter = 0; while (matchPattern.Success) { string followingId = matchPattern.Groups["data"].ToString().Trim(); tlinkData.Create(id, followingId); if (mayEnqueue) { if (accounts.Count < ConfigHelper.Queue_MaxCount) { accounts.Enqueue(followingId); } else { mayEnqueue = false; } } else { if (accounts.Count < ConfigHelper.Queue_MaxCount - skipNewAccounts) { mayEnqueue = true; accounts.Enqueue(followingId); } } matchPattern = matchPattern.NextMatch(); } Console.WriteLine("Created " + (counter++) + " user links for " + id + " followees"); }